async_manager
AsyncManager
A static manager for asynchronous execution in a synchronous context.
By default, it uses MainThreadExecutor. To enable multithreading, call enable_multithreading() to switch to multithreaded event loops.
get_executor
staticmethod
Get the current executor used by AsyncManager.
Returns:
| Type | Description |
|---|---|
IAsyncExecutor
|
An object that implements the IAsyncExecutor interface. |
set_executor
staticmethod
Replace the current asynchronous executor used by AsyncManager with a new executor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
executor
|
IAsyncExecutor
|
An object that implements the IAsyncExecutor interface, responsible for managing and executing asynchronous tasks. |
required |
Returns:
| Type | Description |
|---|---|
None
|
None. |
enable_multithreading
staticmethod
Switch to a multithreaded executor. Tasks will then be dispatched to background threads.