kazoo.handlers.utils¶
Kazoo handler helpers
Public API¶
- kazoo.handlers.utils.capture_exceptions(async_result)[source]¶
Return a new decorated function that propagates the exceptions of the wrapped function to an async_result.
- Parameters:
async_result (
IAsyncResult) – An async result implementingIAsyncResult- Return type:
Callable[[Callable[[ParamSpec(GenericArgs, bound=None)],TypeVar(CapturedResult)]],Callable[[ParamSpec(GenericArgs, bound=None)],TypeVar(CapturedResult) |None]]
- kazoo.handlers.utils.wrap(async_result)[source]¶
Return a new decorated function that propagates the return value or exception of wrapped function to an async_result. NOTE: Only propagates a non-None return value.
- Parameters:
async_result (
IAsyncResult) – An async result implementingIAsyncResult- Return type:
Callable[[Callable[[ParamSpec(GenericArgs, bound=None)],TypeVar(CapturedResult)]],Callable[[ParamSpec(GenericArgs, bound=None)],TypeVar(CapturedResult) |None]]