Skip to main content

Module engine

Module engine 

Source
Expand description

RPC engine: handles incoming RPC requests, dispatches to handlers, and manages request/response lifecycle with timeouts and streaming. Port of Go’s pkg/wshutil/wshrpc.go (WshRpc struct + handler dispatch).

Structs§

RpcRequestHandler
Tracks an outgoing request and collects responses. Matches Go’s RpcRequestHandler.
RpcResponseHandler
Allows an RPC handler to send responses back to the caller. Matches Go’s RpcResponseHandler.
WshRpcEngine
Core RPC engine: handles incoming RPC requests, dispatches to registered command handlers, and manages request/response lifecycle.

Constants§

DEFAULT_TIMEOUT_MS

Type Aliases§

CommandHandler
A boxed async handler function. Takes the command data and returns either:
DispatchGuard
Decides, before a command’s handler runs, whether this connection may call it: Err is the refusal the caller is sent. Set per connection by srv (server::dispatch_guard).
HandlerResult
Result type for RPC handler responses.
StreamHandler
A streaming handler that returns a channel of responses.