Page MenuHomePhabricator

test-uwsgi-threading.py

Authored By
yuvipanda
Mar 9 2015, 11:00 AM
Size
292 B
Referenced Files
None
Subscribers
None

test-uwsgi-threading.py

from flask import Flask
from threading import Thread
app = Flask(__name__)
i = 0
def increment_counter():
global i
i += 1
@app.route('/')
def main():
t = Thread(target=increment_counter)
t.start()
t.join()
return str(i)
if __name__ == '__main__':
app.run()

File Metadata

Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
62733
Default Alt Text
test-uwsgi-threading.py (292 B)

Event Timeline