Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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