All that you ask can be done using the scheduler except that your app does 
not start the process, but submits a request to the scheduler. The 
scheduler runs the app when a worker is available. This is to prevent 
spikes in resource utilization when multiple processes start. The task can 
communicate with the app vid database and/or filesystem (which is ok but 
not 100% satisfactory). Web2py can monitor and kill running scheduler tasks.

This works well for most types of tasks but not for tasks that need a lot 
of IO with your application. I do not have a satisfactory solution in that 
case. You want the tasks to have some way to communicate asynchronously 
with the client and this present major issues, some related with security.

On Friday, 1 February 2013 10:22:35 UTC-6, José Luis Redrejo Rodríguez 
wrote:
>
> Hi, This is a question that has been asked several times in the list, 
> and I have also had to implement this kind of app in the past. 
> Now I'm also facing to another application where I need to run a 
> resource_and_time_consuming process managed from web2py. 
>
> The exact problem is: 
> - From a web page, a long process must be started 
> - The web page must be updated as the process is being done 
> - The web page must be able to cancel the process. 
>
> In the past I have had to deal with the fact of sessions lockings: 
> web2py server doesn't react while the process is being executed. I've 
> solved this by using session.forget(response), but this solution 
> avoids the use of session variables to update the process in the 
> original web page. 
>
> I've used background processes, queues, etc, These solutions work when 
> time is not an issue, but not when the synchronization between the 
> process and the webpage must be fast and accurate 
>
> I wonder if someone has a definitive pattern to do this kind of action. 
>
> Regards 
> José L. 
>

-- 

--- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to