actions/transports.ts view source
Transport transport_name
is_ready
() => booleandispose
() => voidTransport abstraction for action communication.
Provides the Transport interface and Transports registry for managing multiple transports with fallback behavior.
7 declarations
actions/transports.ts view source
Transport transport_nameis_ready() => booleandispose() => voidactions/transports.ts view source
ZodString actions/transports.ts view source
allow_fallbackWhether to allow fallback to other transports if the current one is not available.
type boolean
register_transportRegisters a transport. The first transport registered also becomes the current.
type (transport: Transport): void
transportvoidset_current_transportSwitch the current transport selection by name.
type (transport_name: string): void
transport_namestringvoidError - if no transport with `transport_name` has been registeredget_transportResolve a transport. With allow_fallback, walks specified → current →
any-ready; without, returns the named transport (or current) only when
it's ready.
type (transport_name?: string | undefined): Transport | null
transport_name?string | undefinedTransport | nullthe resolved transport, or null when none is ready
is_readytype (): boolean | null
boolean | nullget_current_transporttype (): Transport | null
Transport | nullget_current_transport_nametype (): string | null
string | nullget_transport_by_nametype (transport_name: string): Transport | null
transport_namestringTransport | nullactions/transports.ts view source
TransportSendOptions Per-call options accepted by every transport's send. Optional and
extensible — adding a field is non-breaking. Source of truth for the
shared option shape; ActionPeerSendOptions and RpcClientCallOptions
extend it.
signalPer-call cancellation. Bottoms out at
FrontendWebsocketClient.request({signal}) on the WS path (sends the
shared cancel notification on abort) and at fetch({signal}) on
HTTP. Backend transport has no per-call abort surface to honor.
AbortSignalqueuePer-call durable-queue opt-in. Names the client-authoritative vs
server-authoritative distinction — server-authoritative consumers
(e.g. zzz completion calls) fail fast with service_unavailable when
the transport is down; client-authoritative consumers (games,
real-time apps) buffer and replay on reconnect because the user
already committed to the action at click time. Honored only by
FrontendWebsocketTransport on the request_response path (default
false). HTTP and backend transports ignore it; WS notifications
also ignore it and always fail-fast when disconnected (fire-and-forget
connection.send has no queue semantic).
booleanactions/transports.ts view source
4002 WebSocket close code — client timed out waiting for a response.
actions/transports.ts view source
4003 WebSocket close code — server timed out with no incoming activity.
actions/transports.ts view source
4001 WebSocket close code for session revocation.