[Web-SIG] WSGI and greenlets

Christopher Stawarz cstawarz at csail.mit.edu
Thu May 22 20:10:02 CEST 2008

On May 22, 2008, at 4:51 AM, Manlio Perillo wrote:

> I'm reading the PEP 342, and I still think that this will not work  
> as I want for Nginx (where I have no control over the "scheduler").
> In fact the PEP 342 says:
> """However, if it were possible to pass values or exceptions *into* a
> generator at the point where it was suspended, a simple co-routine
> scheduler or "trampoline function" would let coroutines "call" each
> other without blocking."""
> However writing a co-routine scheduler or "trampoline function" when  
> your application is embedded in an external server is not possible  
> (but please, correct me if I'm wrong).

That's correct.  My with_callstack wrapper supports calling  
subroutines (which can yield values to the server or return results to  
their caller) within a single application instance.  It doesn't  
support switching between app instances, since that's the server's  
job.  Therefore, it doesn't help with your DB connection pool example.


More information about the Web-SIG mailing list