How to Create an Async App
Cycls supports asynchronous (async
) applications, ideal for applications requiring high performance and scalability.
Creating an Async App
By following the steps below, you can create an asynchronous app with Cycls:
1
Import `AsyncApp`
Instead of importing App
, you will import AsyncApp
from Cycls.
main.py
2
Set Up the Entry Point
Define the entry point for your application, where the async responses will be handled.
main.py
3
Publish Your App
Publish your app by calling the publish
method.
main.py
4
Run Your App
Run your app in the directory containing main.py
:
Complete Example
Here is the complete code for setting up an async app:
main.py