yes, but for me it is not a problem since all my functions lives in modules.

But, I have one solution for this problem, I created a plugin_rq.py which
is a module and it has a class Queue and the enqueue method which works
good for functions defined in models.

Also I am implementing the monitoring feature in the plugin.

On Wed, Jan 2, 2013 at 6:47 PM, Niphlod <[email protected]> wrote:

> tried with python-rq before and as much as I like it (if you can bear the
> limitations) I can't get any function that is defined in models to be
> executed.
>
> Guess it's something related to web2py's execution environment...... if
> you're going to use mail.send then it's ok, but what if you must enqueue a
> function defined in models ?
>
> import time
> def demo1(*args, **vars):
>     time.sleep(15)
>     print 'args', args
>     print 'vars', vars
>     return dict(args=args, vars=vars)
>
>
>
> it gets serialized as __restricted__.demo1, and when loaded into the
> worker it obviously goes into exception. Did you find an alternative to
> make that work ?
>
>
> On Monday, December 31, 2012 7:16:43 AM UTC+1, rochacbruno wrote:
>
>> The monitor tool runs on Flask I am sure it will be easy to write a
>> web2py version of this. Maybe as a plugin.
>> Em 31/12/2012 00:09, "Bruno Rocha" <[email protected]> escreveu:
>>
>>
>>> Running delayed jobs with web2py and Redis Queue:
>>>
>>> http://rochacbruno.com.br/**web2py-and-redis-queue/<http://rochacbruno.com.br/web2py-and-redis-queue/>
>>>
>>> Bruno.
>>>
>>  --
>
>
>
>

-- 



Reply via email to