Page MenuHomePhabricator
Paste P373

test-uwsgi-threading.py
ActivePublic

Authored by yuvipanda on Mar 9 2015, 11:00 AM.
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()

Event Timeline

yuvipanda edited the content of this paste. (Show Details)Mar 9 2015, 11:00 AM
yuvipanda changed the title of this paste from untitled to test-uwsgi-threading.py.
yuvipanda updated the paste's language from autodetect to autodetect.