Undocumented
Constant | ENABLE_ASYNCIO |
Undocumented |
Function | _assume_async |
Run a function in an asyncio loop unconditionally. |
Function | _maybe_async |
Run a function in an asyncio loop if the current selected driver is async. |
Function | _maybe_async_provisioning |
Run a function in an asyncio loop if any current drivers might need it. |
Function | _maybe_async_wrapper |
Apply the _maybe_async function to an existing function and return as a wrapped callable, supporting generator functions as well. |
Function | _run_coroutine_function |
Undocumented |
Run a function in an asyncio loop unconditionally.
This function is used for provisioning features like testing a database connection for server info.
Note that for blocking IO database drivers, this means they block the event loop.
Run a function in an asyncio loop if the current selected driver is async.
This function is used for test setup/teardown and tests themselves where the current DB driver is known.
Run a function in an asyncio loop if any current drivers might need it.
This function is used for provisioning features that take place outside of a specific database driver being selected, so if the current driver that happens to be used for the provisioning operation is an async driver, it will run in asyncio and not fail.
Note that for blocking IO database drivers, this means they block the event loop.