Ver código fonte

Can now override type of Consumer.strategies (dict)

Ask Solem 11 anos atrás
pai
commit
d8559580bd
1 arquivos alterados com 3 adições e 1 exclusões
  1. 3 1
      celery/worker/consumer.py

+ 3 - 1
celery/worker/consumer.py

@@ -120,6 +120,8 @@ def dump_body(m, body):
 
 
 
 
 class Consumer(object):
 class Consumer(object):
+    Strategies = dict
+
     #: set when consumer is shutting down.
     #: set when consumer is shutting down.
     in_shutdown = False
     in_shutdown = False
 
 
@@ -165,7 +167,7 @@ class Consumer(object):
         self.pid = os.getpid()
         self.pid = os.getpid()
         self.pool = pool
         self.pool = pool
         self.timer = timer or default_timer
         self.timer = timer or default_timer
-        self.strategies = {}
+        self.strategies = self.Strategies()
         conninfo = self.app.connection()
         conninfo = self.app.connection()
         self.connection_errors = conninfo.connection_errors
         self.connection_errors = conninfo.connection_errors
         self.channel_errors = conninfo.channel_errors
         self.channel_errors = conninfo.channel_errors