tasks.py 197 B

12345678910111213
  1. from __future__ import absolute_import
  2. from celery import Celery
  3. app = Celery('tasks', broker='amqp://')
  4. @app.task()
  5. def add(x, y):
  6. return x + y
  7. if __name__ == '__main__':
  8. app.start()