On Sun, Jul 22, 2012 at 12:57 AM, dsfdf <
gokop...@gmail.com> wrote:
> The basic idea is as follows:
>
> a request comes to views1 and it first returns the username. There is some heavy job separate done by do_something_else right after views1 is done.
Then just call do_something_else() at the end of views1().
> gevent.joinall([
> gevent.spawn(views1, parmeter1, parmeter2, ...),
> gevent.spawn(do_something_else, parmeter1, parmeter2, ...)
> ])
You said you want to run do_something_else() after views1() but
actually run them concurrently.
> The problem is I don't think do_something_else was ever called based on my logging.
This might happen if you did not monkey patch the standard library to
be cooperative or the server running your app is not integrated into
gevent event loop.
> I read tutorial and I don't know where to place gevent.sleep(0).
You rarely, almost never, need to place gevent.sleep(0) anywhere.
> Any idea?
If you can make a small self-contained script that shows your problem
(and explain how exactly you run it if it's a web app), it'll be much
easier to help you.