This is incorrect usage of
generators<http://docs.python.org/tutorial/classes.html#generators>
.

Perhaps you meant:
def test():
    yield “this is from test”

def main_handler(environ, start_response):
    start_response('200 OK', [('Content-Type', 'text/html')])
    for output in test():
        yield output
    yield “this is from main”

On Fri, Jun 10, 2011 at 1:31 AM, Lixin Yao <[email protected]> wrote:

>  Hi,
>
>
>
> With nginx and uwsgi, the yield in test function (see following code) does
> not work. It does not really yield anything.
>
>
>
>
>
> def test():
>
> yield “this is from test”
>
>
>
> def main_handler(environ, start_response):
>
>     start_response('200 OK', [('Content-Type', 'text/html')])
>
> test()
>
> yield “this is from main”
>
>
>
> How do you solve this?
>
>
>
> Thanks.
>
>
>
> Lixin Yao
>
> _______________________________________________
> uWSGI mailing list
> [email protected]
> http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
>
>
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to