tasks.py 265 B

123456789101112131415161718
  1. # Create your tasks here
  2. from __future__ import absolute_import, unicode_literals
  3. from celery import shared_task
  4. @shared_task
  5. def add(x, y):
  6. return x + y
  7. @shared_task
  8. def mul(x, y):
  9. return x * y
  10. @shared_task
  11. def xsum(numbers):
  12. return sum(numbers)