簡體   English   中英

如何從Redis入隊RQ中的工作

[英]How to enqueue a job in rq from redis

我必須從mysql執行時獲取函數和時間,然后將其保存到redis中。現在從redis中我必須在規定的時間執行函數。我想使用rq作為調度程序,但無法在其中找到模型我應該將導入的數據保存到redis中。 我對python和redis完全陌生

如果您安裝redis,則有一個文件(對我來說是〜/ lib / python2.7 / site-packages / rq / queue.py,它依次調用job.py)清楚地說明了enqueue和enqueue_call函數:

def enqueue_call(self, func, args=None, kwargs=None,
                 timeout=None, result_ttl=None, description=None,
                 depends_on=None):
    """Creates a job to represent the delayed function call and enqueues it.

    It is much like `.enqueue()`, except that it takes the function's args
    and kwargs as explicit arguments.  Any kwargs passed to this function
    contain options for RQ itself.
    etc...."""

def enqueue(self, f, *args, **kwargs):
    """Creates a job to represent the delayed function call and enqueues it.

    Expects the function to call, along with the arguments and keyword
    arguments.
    etc...."""

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM