Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 23 lines (22 sloc) 0.555 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
import uwsgi
if uwsgi.loop == 'gevent':
    import gevent

print uwsgi.version
print uwsgi.workers()
try:
    uwsgi.cache_set('foo', "Hello World from cache")
except:
    pass
def application(env, start_response):
    if uwsgi.loop == 'gevent':
        gevent.sleep()
    start_response('200 OK', [('Content-Type', 'text/html')])
    yield "foobar<br/>"
    if uwsgi.loop == 'gevent':
        gevent.sleep(3)
    yield str(env['wsgi.input'].fileno())
    yield "<h1>Hello World</h1>"
    try:
        yield uwsgi.cache_get('foo')
    except:
        pass
Something went wrong with that request. Please try again.