Skip to content

Instantly share code, notes, and snippets.

@antunesleo
Last active February 14, 2020 02:08
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/c07e3e8b12694dbe638b26a3ab9439eb to your computer and use it in GitHub Desktop.
Save antunesleo/c07e3e8b12694dbe638b26a3ab9439eb to your computer and use it in GitHub Desktop.
from celery_stuff.tasks import serve_a_beer, serve_a_coffee # Importing the task
def start_serve_a_beer():
""" Starts the execution of a celery task with the delay method.
the delay method doesn't wait the task execution be finished.
"""
serve_a_beer.apply_async(('weiss', '500ml'))
print('This will be executed before the serve_a_beer task be finished')
def start_serve_a_coffee():
""" Starts the execution of a celery task with the delay method.
the delay method doesn't wait the task execution be finished.
"""
serve_a_coffee.apply_async(('express', 'small'))
print('This will be executed before the serve_a_beer task be finished')
start_serve_a_beer()
start_serve_a_coffee()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment