Adds more brokers

* added IronMQ
* added Aws SQS
* removed SafeRedis.
 During tests the 'safe' part wasn't consistent enough
This commit is contained in:
Ilan Steemers
2015-09-02 19:04:03 +02:00
parent da20ebe734
commit 8ce441bed5
13 changed files with 314 additions and 49 deletions
+13 -5
View File
@@ -35,6 +35,16 @@ class Conf(object):
# Disque broker
DISQUE = conf.get('disque', None)
# Optional Authentication
DISQUE_AUTH = conf.get('disque_auth', None)
# Amazon SQS broker
SQS = conf.get('sqs', None)
# IronMQ broker
IRONMQ = conf.get('ironmq', None)
if IRONMQ and os.environ.get('IRONMQ_TOKEN'):
IRONMQ['token'] = os.environ['IRONMQ_TOKEN']
# Name of the cluster or site. For when you run multiple sites on one redis server
PREFIX = conf.get('name', 'default')
@@ -46,9 +56,6 @@ class Conf(object):
# Failures are always saved
SAVE_LIMIT = conf.get('save_limit', 250)
# Maximum number of tasks that each cluster can work on
QUEUE_LIMIT = conf.get('queue_limit', None)
# Number of workers in the pool. Default is cpu count if implemented, otherwise 4.
WORKERS = conf.get('workers', False)
if not WORKERS:
@@ -63,6 +70,9 @@ class Conf(object):
# sensible default
WORKERS = 4
# Maximum number of tasks that each cluster can work on
QUEUE_LIMIT = conf.get('queue_limit', None)
# Sets compression of redis packages
COMPRESSED = conf.get('compress', False)
@@ -96,8 +106,6 @@ class Conf(object):
# Django itself should raise an error if it's not configured
SECRET_KEY = settings.SECRET_KEY
# The redis list key
Q_LIST = 'django_q:{}:q'.format(PREFIX)
# The redis stats key
Q_STAT = 'django_q:{}:cluster'.format(PREFIX)