Skip to content

Instantly share code, notes, and snippets.

@antunesleo
Last active February 14, 2020 02:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save antunesleo/0c87fe139fa0ce10579e6174a9087f14 to your computer and use it in GitHub Desktop.
Save antunesleo/0c87fe139fa0ce10579e6174a9087f14 to your computer and use it in GitHub Desktop.
from celery_stuff.tasks import serve_a_beer # Importing the task
def start_serve_a_beer():
""" Adds serve_a_beer task to the queue with apply_async method.
the method doesn't wait the task execution be finished.
"""
serve_a_beer.apply_async(('weiss', '500ml')) # Just add's to a queue, to be executed when celery reads the queue
print('This will be executed before the serve_a_beer task be finished')
start_serve_a_beer()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment