[PEAK] StopIteration: Unexpected reactor exit

Phillip J. Eby pje at telecommunity.com
Thu Mar 25 16:31:45 EST 2004


At 01:11 PM 3/25/04 -0800, John Landahl wrote:

>What about for a synchronous caller and asynchronous callees?  Something like:
>
>   func1   (synchronous)
>     func2 (synchronous)
>       reactor.spawnProcess (asynchronous)
>       PB call (asynchronous)
>
>func2 works on the data from the two asynchronous sources and returns its 
>results to func1.  Is there something other than EventLoop.runUntil that 
>can make this possible?  Since func2 needs to be synchronous, it can't be 
>converted to a generator Task.

If what you just showed is *all* your program does, you wouldn't have 
another event loop.  func2 would make two (non-nested) runUntil() calls, 
and that would be that.

So, either your diagram above is wrong and there's something else going on, 
or I've completely misunderstood what your problem is, or you're doing 
something really weird.  :)

So...  is func1 being called from the reactor, or is it a top-level 
program?  If it's  called from the reactor, you have a synchrony sandwich 
(sync code between two layers of async) and you have a problem.




More information about the PEAK mailing list