Sean O'Donnells Weblog
The MRQ documention is vague on how to add jobs to a queue from code. Particularly if you want to do it from a remote system (one the worker is not running on).
The following snippet does the job
from mrq.job import queue_job, contextShare on Twitter Share on Facebook
context.setup_context(
extra={
'redis': 'redis://my_redis_url',
'mongodb_jobs': 'mongodb://my_mongo_url',
})
queue_job("tasks.MyTask", {'arg1': "myarg"}, queue="myqueue")
Comments
New Comment