tasks.py 214 B

123456789101112
  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()