Browse Source

Celery actors will be moved to cl

Ask Solem 13 years ago
parent
commit
f6214b2a45
2 changed files with 0 additions and 57 deletions
  1. 0 30
      celery/actors.py
  2. 0 27
      celery/tests/test_app/test_actors.py

+ 0 - 30
celery/actors.py

@@ -1,30 +0,0 @@
-from __future__ import absolute_import
-
-from celery.app import app_or_default
-
-import cl
-import cl.presence
-
-
-def construct(cls, instance, connection=None, *args, **kwargs):
-    app = instance.app = app_or_default(kwargs.pop("app", None))
-    super(cls, instance).__init__(connection or app.broker_connection(),
-                                  *args, **kwargs)
-
-
-class Actor(cl.Actor):
-
-    def __init__(self, *args, **kwargs):
-        construct(Actor, self, *args, **kwargs)
-
-
-class Agent(cl.Agent):
-
-    def __init__(self, *args, **kwargs):
-        construct(Agent, self, *args, **kwargs)
-
-
-class AwareAgent(cl.presence.AwareAgent):
-
-    def __init__(self, *args, **kwargs):
-        construct(AwareAgent, self, *args, **kwargs)

+ 0 - 27
celery/tests/test_app/test_actors.py

@@ -1,27 +0,0 @@
-from __future__ import absolute_import
-
-from kombu import BrokerConnection
-
-from celery.actors import Actor, Agent, AwareAgent
-
-from celery.tests.utils import AppCase
-
-
-class test_using_connection(AppCase):
-
-    def assertConnection(self, cls):
-        x = cls(app=self.app)
-        self.assertTrue(x.connection)
-
-        conn = BrokerConnection(transport="memory")
-        x = cls(app=self.app, connection=conn)
-        self.assertIs(x.connection, conn)
-
-    def test_Actor(self):
-        self.assertConnection(Actor)
-
-    def test_Agent(self):
-        self.assertConnection(Agent)
-
-    def test_AwareAgent(self):
-        self.assertConnection(AwareAgent)