Functions
invoke
3
Any
▼
Call a handler and await the result if it's a coroutine.
Works with both sync …
async
invoke
3
Any
▼
async def invoke(handler: Any, *args: Any, **kwargs: Any) -> Any
Call a handler and await the result if it's a coroutine.
Works with both sync and async callables::
# sync — returns immediately, no await needed
@login_required
def dashboard():
return Template("dashboard.html")
# async — returns coroutine, awaited automatically
@login_required
async def dashboard():
data = await fetch_data()
return Template("dashboard.html", data=data)
Parameters
| Name | Type | Description |
|---|---|---|
handler |
Any |
|
*args |
Any |
|
**kwargs |
Any |
Returns
Any