July 2018
Intermediate to advanced
324 pages
8h 14m
English
Zappa provides a super-easy way to configure your Lambda execution in asynchronous mode. Zappa has an implementation of asynchronous execution using a decorator method called zappa.async.task. This decorator can be used with any function we want to execute in asynchronous mode. The following is an example from Zappa's official GitHub page (https://github.com/Miserlou/Zappa#asynchronous-task-execution):
from flask import Flaskfrom zappa.async import taskapp = Flask(__name__)@taskdef make_pie(): """ This takes a long time! """ ingredients = get_ingredients() pie = bake(ingredients) deliver(pie)@app.route('/api/order/pie')def order_pie(): """ This returns immediately! """ make_pie() ...Read now
Unlock full access