does that function work inside a "normal" web2py shell ? On Tuesday, November 5, 2013 4:14:51 PM UTC+1, Sheng-Kai Huang wrote: > > hello > > I want to use the concurrent libary to do somthing parallelly and > periodly, so I have following code inside a model function of web2py > scheluer. > > def function(): > """ > some code > """ > executor = futures.ThreadPoolExecutor(max_workers=100) > jobs = [executor.submit( foo, param) for param in list] > > > So far my cron function in scheduler run normally > However, when I try to retrieve the return values of all threads, the > scheduler_task.status becomes RUNNING and never changes. > Even the child process has printed the "why", the task_status is stay in > RUNINING .The results is my cron job just runs once. > If not adding these two lines, the job executes normally, turning the > status to QUEUE. > > > def function(): > """ > some code > """ > executor = futures.ThreadPoolExecutor(max_workers=100) > jobs = [executor.submit( foo, param) for param in list] > for j in jobs: # retrived some values > print j.result(). > > print "why" > > > Could anyone give me a tip? how should I solve this problem > > Thx > >
-- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.

