Re: multiprocessing module in async db query

2011-03-09 Thread Philip Semanchuk
On Mar 9, 2011, at 10:22 AM, Sheng wrote: > Hi Philip, > > multiprocessing.Queue is used to transfer data between processes, how > it could be helpful for solving my problem? Thanks! I misunderstood -- I thought transferring data between processes *was* your problem. If both of your functions

Re: multiprocessing module in async db query

2011-03-09 Thread Sheng
Hi Philip, multiprocessing.Queue is used to transfer data between processes, how it could be helpful for solving my problem? Thanks! Sheng On Mar 8, 6:34 pm, Philip Semanchuk wrote: > On Mar 8, 2011, at 3:25 PM, Sheng wrote: > > > This looks like a tornado problem, but trust me, it is almost al

Re: multiprocessing module in async db query

2011-03-08 Thread John Nagle
On 3/8/2011 3:34 PM, Philip Semanchuk wrote: On Mar 8, 2011, at 3:25 PM, Sheng wrote: This looks like a tornado problem, but trust me, it is almost all about the mechanism of multiprocessing module. [snip] So the workflow is like this, get() --> fork a subprocess to process the query re

Re: multiprocessing module in async db query

2011-03-08 Thread Philip Semanchuk
On Mar 8, 2011, at 3:25 PM, Sheng wrote: > This looks like a tornado problem, but trust me, it is almost all > about the mechanism of multiprocessing module. [snip] > So the workflow is like this, > > get() --> fork a subprocess to process the query request in > async_func() -> when async_fun

multiprocessing module in async db query

2011-03-08 Thread Sheng
This looks like a tornado problem, but trust me, it is almost all about the mechanism of multiprocessing module. I borrowed the idea from http://gist.github.com/312676 to implement an async db query web service using tornado. p = multiprocessing.Pool(4) class QueryHandler(tornado.web.RequestHandl