/
How to use async function in python
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.
Related content
Campus Life
Campus Life
Read with this
Development Practices for APU APPS
Development Practices for APU APPS
More like this
APFace
APFace
Read with this
Copyright © Asia Pacific University. All Rights Reserved.