mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-06-16 02:15:48 +00:00
21 lines
359 B
Python
21 lines
359 B
Python
import uwsgi
|
|
import threading
|
|
import time
|
|
|
|
|
|
def foo():
|
|
while True:
|
|
time.sleep(1)
|
|
print "ciao, sono un thread"
|
|
|
|
t = threading.Thread(target=foo)
|
|
t.daemon = True
|
|
t.start()
|
|
|
|
|
|
def application(e, s):
|
|
s('200 OK', [('Content-Type', 'text/html')])
|
|
for i in range(0, 3):
|
|
yield uwsgi.async_sleep(1)
|
|
yield "iter: %d<br/>" % i
|