Skip to content

Instantly share code, notes, and snippets.

@kmadac
Last active August 29, 2015 14:17
Show Gist options
  • Save kmadac/a1ce6374eb25ed251abc to your computer and use it in GitHub Desktop.
Save kmadac/a1ce6374eb25ed251abc to your computer and use it in GitHub Desktop.
# using: rqworker -P /Path/To/Dir/With/NewWorker -w NewWorker.NewWorker -c settings
from rq import Worker
# import CustomLibs
class NewWorker(Worker):
def __init__(self, *args, **kwargs):
# Lets prepare database connection here
# take settings from environment variables, or configuration file
# self.db = CustomLibs.DB.Connect(*settings)
super(NewWorker, self).__init__(*args, **kwargs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment