Thank you Tim, now I think I get it! I was confused because I thought that 
every time I wanted to run a background task I had to run that python 
command.

Thanks again!

On Friday, January 31, 2014 8:19:47 AM UTC+2, Tim Richardson wrote:
>
>
>
> On Friday, 31 January 2014 08:43:29 UTC+11, desta wrote:
>>
>> Thanks for the reply!
>>
>> I see how you queue your tasks. However, the scheduler documentation 
>> states that I have to run 
>>
>> python web2py.py -K myapp
>>
>> in order to run the workers. This is the part that I don't understand. 
>> How should I run the above command?
>>
>
> You run it from your shell; it starts a separate python process. That's 
> actually the point :) You can't run it from your controller.
> That's because your controllers are very short-lived threads; they end as 
> soon as the response to the client request is composed. 
>
> In production, you will run the scheduler as a background process (or in 
> Windows-speak, a service). The book has deployment recipes for Linux and 
> Windows.
> You can choose to have one scheduler supporting multiple apps if you wish, 
> or multiple schedulers (one per app). 
> There are different ways to get processes talking to each other. The 
> scheduler communicates via database records: it watches a certain table to 
> look for new jobs, and it puts progress and output back into a table. 
>
>
> It is an extremely awesome thing and worth learning.
>
>

-- 
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.

Reply via email to