Hi, 

I have created a simple pyramid app below with two views, which is served 
by waitress.
When I requested for view1 and view2 in a browser on two separate tabs, 
they took about the same time to complete. 
As waitress is multi-threaded, this was expected. However, when I tried to 
request for view1 on two separate tabs, 
the second request had to wait for the first request to complete before it 
could start. How can I have two requests for view1 to be processed
simultaneously ? Thanks.


import time
from pyramid.config import Configurator
from pyramid.response import Response

def view1(request):
    print 'Inside view1'
    time.sleep(10)
    return Response('Ok')

def view2(request):
    print 'Inside view2'
    time.sleep(10)    
    return Response('Ok')

def make_app():
    config = Configurator()
    config.add_route('view1', '/view1')
    config.add_view(view1, route_name='view1')
    config.add_route('view2', '/view2')
    config.add_view(view2, route_name='view2')
    return config.make_wsgi_app()

if __name__ == '__main__':
    from waitress import serve
    serve(make_app(), host='0.0.0.0', port=6543)

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to