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§

EngineInner 🔒
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.

Enums§

Handler 🔒

Constants§

DEFAULT_TIMEOUT_MS
RESP_CH_SIZE 🔒

Type Aliases§

CommandHandler
A boxed async handler function. Takes the command data and returns either:
HandlerResult
Result type for RPC handler responses.
StreamHandler
A streaming handler that returns a channel of responses.