tasks.py 215 B

12345678910111213
  1. from __future__ import absolute_import, unicode_literals
  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()