Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F65177
test-uwsgi-threading.py
No One
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Authored By
yuvipanda
Mar 9 2015, 11:00 AM
2015-03-09 11:00:34 (UTC+0)
Size
292 B
Referenced Files
None
Subscribers
None
test-uwsgi-threading.py
View Options
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
Details
Attached
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)
Attached To
Mode
P373 test-uwsgi-threading.py
Attached
Detach File
Event Timeline
Log In to Comment