Last active
February 14, 2020 02:05
-
-
Save antunesleo/0c87fe139fa0ce10579e6174a9087f14 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 # 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