Guest User

Untitled

a guest
Jul 16th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.23 KB | None | 0 0
  1. from celery import Celery
  2.  
  3. celery = Celery("myapp")
  4.  
  5. @celery.task
  6. def add(x, y):
  7.     return x + y
  8.  
  9. if __name__ == "__main__":
  10.     options = {"BROKER_URL": "amqp://guest:guest@localhost:5672//"}
  11.     celery.Worker(**options).run()
Add Comment
Please, Sign In to add comment