tasks.py 211 B

123456789101112131415161718
  1. from __future__ import absolute_import
  2. from proj.celery import app
  3. @app.task
  4. def add(x, y):
  5. return x + y
  6. @app.task
  7. def mul(x, y):
  8. return x * y
  9. @app.task
  10. def xsum(numbers):
  11. return sum(numbers)