API Reference


Coroutine Factory

asyncx.just

Creates a coroutine that returns a specified result.

asyncx.wait_any

Creates a coroutine that waits for any of given awaitables to be completed.

asyncx.wait_all

Creates a coroutine that waits for all of given awaitables to be completed.

Shielding

asyncx.shield

A decorator for an async function to protect it from being cancelled.

Context Manager

asyncx.acontext

Creates an async context manager that cancels a given awaitable in __aexit__.

Thread Handling

asyncx.EventLoopThread

An event loop thread that provides thread-safe utility functions.

asyncx.run_coroutine_in_thread

Submit a coroutine in a new thread and waits for its completion in a given loop.

Event Loop

asyncx.dispatch

A decorator to dispatch an async function to another event loop.