ezmsg.sigproc.util.asio#

Functions

run_coroutine_sync(coroutine, timeout=30)[source]#

Executes an asyncio coroutine synchronously, with enhanced error handling.

Parameters:
  • coroutine (Coroutine[Any, Any, T]) – The asyncio coroutine to execute

  • timeout (float) – Maximum time in seconds to wait for coroutine completion (default: 30)

Returns:

The result of the coroutine execution

Raises:
Return type:

T

Classes

class SyncToAsyncGeneratorWrapper(gen)[source]#

Bases: object

A wrapper for synchronous generators to be used in an async context.

__init__(gen)[source]#
async asend(value)[source]#
async aclose()[source]#

Exceptions

exception CoroutineExecutionError[source]#

Bases: Exception

Custom exception for coroutine execution failures

exception CoroutineExecutionError[source]#

Bases: Exception

Custom exception for coroutine execution failures

run_coroutine_sync(coroutine, timeout=30)[source]#

Executes an asyncio coroutine synchronously, with enhanced error handling.

Parameters:
  • coroutine (Coroutine[Any, Any, T]) – The asyncio coroutine to execute

  • timeout (float) – Maximum time in seconds to wait for coroutine completion (default: 30)

Returns:

The result of the coroutine execution

Raises:
Return type:

T

class SyncToAsyncGeneratorWrapper(gen)[source]#

Bases: object

A wrapper for synchronous generators to be used in an async context.

__init__(gen)[source]#
async asend(value)[source]#
async aclose()[source]#