mirror of https://github.com/peter4431/rq.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
462 B
Python
18 lines
462 B
Python
from logbook import Logger
|
|
from .worker import Worker
|
|
|
|
def run_daemon(queue_keys, rv_ttl=500):
|
|
"""Simple implementation of a Redis queue worker, based on
|
|
http://flask.pocoo.org/snippets/73/
|
|
|
|
Will listen endlessly on the given queue keys.
|
|
"""
|
|
worker = Worker(queue_keys, rv_ttl)
|
|
|
|
log = Logger('worker')
|
|
log.info('Listening for messages on Redis queues:')
|
|
for key in queue_keys:
|
|
log.info('- %s' % (key,))
|
|
|
|
worker.work()
|