Last active
February 14, 2020 02:08
-
-
Save antunesleo/c07e3e8b12694dbe638b26a3ab9439eb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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