> To explain my problem better, please see following (incomplete pseudo)
> code:
>
> import webob
>
> class Decider:
>    def handle(self, env):
>        request = webob.Request(env.copy())
>        if request.charset is None:
>            request.charset = 'utf8'
>        # do something more useful here
>        port = random.randint(request.POST['start'], request.POST['end'])
>
>
> def application(env, start_response):
>    router = Decider()
>    port = router.handle(env)
>    # we have various uwsgi servers awaiting http requests at ports 30XX
> (start < XX < end)
>    fd = ':30' + str(port)
>    # webob.Request creation will read body, is there a way to rewind?
>    env['wsgi.input'].read(-1)
>    for part in uwsgi.send_message(fd, 0, 0, env, 0,
> env['wsgi.input'].fileno(), uwsgi.cl()):
>        yield part
>
> Setup is a uwsgi emporer setup, 1 router (code above), and a certain
> number of uwsgi servers with http-sockes awaiting requests.
>
> Can I use uwsgi to solve this problem?
>
> Thanks,
> Kaweh
>

Hi Kaweh, sorry i am at europython so i am not able to check if the whole
custom routing part is healthy. By the way the uwsgi.send_message function
build uwsgi packet, si your instance have to open a uwsgi socket too
(--socket <address>)

>
-- 
Roberto De Ioris
http://unbit.it
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to