tasks.py 224 B

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