call_handler
faststream.broker.test.call_handler async #
call_handler(
handler: AsyncHandler[Any],
message: Any,
rpc: bool = False,
rpc_timeout: Optional[float] = 30.0,
raise_timeout: bool = False,
) -> Optional[SendableMessage]
Asynchronously call a handler function.
| PARAMETER | DESCRIPTION |
|---|---|
handler | The handler function to be called. TYPE: |
message | The message to be passed to the handler function. TYPE: |
rpc | Whether the call is a remote procedure call (RPC). TYPE: |
rpc_timeout | The timeout for the RPC, in seconds. |
raise_timeout | Whether to raise a timeout error if the RPC times out. TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
Optional[SendableMessage] | The result of the handler function if |
| RAISES | DESCRIPTION |
|---|---|
TimeoutError | If the RPC times out and |