Skip to content

Instantly share code, notes, and snippets.

@codeAshu
Created July 2, 2017 12:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codeAshu/11d1e3a981e83a0275db42bd6379900f to your computer and use it in GitHub Desktop.
Save codeAshu/11d1e3a981e83a0275db42bd6379900f to your computer and use it in GitHub Desktop.
import os
import redis
from rq import Worker, Queue, Connection
listen = ['default']
redis_url = os.getenv('REDISTOGO_URL', 'redis://localhost:6379')
conn = redis.from_url(redis_url)
if __name__ == '__main__':
with Connection(conn):
worker = Worker(list(map(Queue, listen)))
worker.work()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment