cortex.utils.loop¶
loop ¶
Event loop utilities for Cortex.
Provides uvloop integration for improved async performance on Unix systems.
Functions¶
run ¶
Run a coroutine, preferring uvloop when available.
Drop-in replacement for :func:asyncio.run. On Unix with uvloop
installed, this yields noticeably lower tail latency on high-rate
small-message workloads.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
coro
|
Coroutine[Any, Any, Any]
|
The top-level coroutine to run to completion. |
required |
debug
|
bool
|
Pass through to the event loop's |
False
|
Returns:
| Type | Description |
|---|---|
Any
|
Whatever |