How to use async function in python

Following example shows that when function A() is executed, function B() is also executed!

def functionA(): db.session.query(example_code) functionB() def functionB(): email.send()

If we want to use async for functionB() we need to do the following

To use async function, we have to import following module:

from zappa.async import task

use @TASK before the start of function:

@task def functionB(): email.send()

that’s all we need to do.

Copyright © Asia Pacific University. All Rights Reserved.