Browse Source

Fixes examples/app

Ask Solem 12 years ago
parent
commit
98eca36a45
1 changed files with 3 additions and 20 deletions
  1. 3 20
      examples/app/myapp.py

+ 3 - 20
examples/app/myapp.py

@@ -12,32 +12,15 @@ Usage:
 
 You can also specify the app to use with celeryd::
 
-    $ celeryd -l info --app=myapp.celery
+    $ celery worker -l info --app=myapp
 
 """
 from celery import Celery
 
+celery = Celery("myapp", broker="amqp://guest@localhost//")
 
-def debug_args(fun):
-    from kombu.utils import reprcall
 
-    def _inner(self, *args, **kwargs):
-        print("CALL: %r" % reprcall(self.name, args, kwargs))
-        return fun(*args, **kwargs)
-    return _inner
-
-
-
-celery = Celery("myapp")
-celery.conf.update(
-    BROKER_URL="amqp://guest:guest@localhost:5672//",
-    CELERY_ANNOTATIONS={
-        "myapp.add": {"@__call__": debug_args},
-    },
-)
-
-
-@celery.task
+@celery.task()
 def add(x, y):
     return x + y