Created
March 29, 2017 17:09
-
-
Save Miserlou/48ac23deb60cd21a74fecd5f1d558a8c to your computer and use it in GitHub Desktop.
zappa_task_example.py
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
import flask | |
from zappa.async import task | |
@task | |
def make_pie(): | |
""" This takes a long time! """ | |
ingredients = get_ingredients() | |
pie = bake(ingredients) | |
deliver(pie) | |
@flask.route('/api/order/pie') | |
def order_pie(): | |
""" This returns immediately! """ | |
make_pie() | |
return "Your pie is being made!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment