Skip to content

Graphorin API reference v0.7.0


Graphorin API reference / @graphorin/server / ws

ws

@graphorin/server/ws - WebSocket protocol implementation for the Graphorin standalone server. Combines the dispatcher (which fans events out to subscribers + applies the delivery-layer commentary sanitization), the in-memory ticket store (browser single-use ticket flow), the per-subject replay buffer, the strict subject grammar parser + scope check, and the @hono/node-ws upgrade handler.

Interfaces

InterfaceDescription
ReplayBufferStatsOccupancy snapshot returned by ReplayBuffer.stats.

Type Aliases

Type AliasDescription
ParseSubjectResultResult of tryParseSubject.

Functions

FunctionDescription
isSubjectAllowedCompatibility shim - re-exports scopeMatches so consumers don't have to learn the security package's surface.
scheduleReplayBufferPruningW-028: schedule a periodic ReplayBuffer.prune sweep. Without it TTL expiry only ran lazily inside push/replay/size FOR THE SAME SUBJECT, so every finished run-subject (a fresh runId per run) retained up to maxEvents full payloads forever on a long-living server. Mirrors scheduleRunPruning (IP-16): unref-ed timer, returns a stop function. The sweep applies only the already documented TTL - replay semantics inside the TTL window are unchanged (an immediate forget on run completion would break short-disconnect resume of terminal events).

References

BareEventFrame

Re-exports BareEventFrame


createReplayBuffer

Re-exports createReplayBuffer


createWsDispatcher

Re-exports createWsDispatcher


createWsTicketStore

Re-exports createWsTicketStore


createWsUpgradeEvents

Re-exports createWsUpgradeEvents


ParsedSubject

Re-exports ParsedSubject


ReplayBuffer

Re-exports ReplayBuffer


ReplayBufferOptions

Re-exports ReplayBufferOptions


ReplayBufferSlice

Re-exports ReplayBufferSlice


requiredScopeFor

Re-exports requiredScopeFor


SubscribeResult

Re-exports SubscribeResult


tryParseSubject

Re-exports tryParseSubject


WsDispatcher

Re-exports WsDispatcher


WsDispatcherOptions

Re-exports WsDispatcherOptions


WsDispatcherWarning

Re-exports WsDispatcherWarning


WsSubscriberHandle

Re-exports WsSubscriberHandle


WsSubscriptionSnapshot

Re-exports WsSubscriptionSnapshot


WsTicket

Re-exports WsTicket


WsTicketConsumeResult

Re-exports WsTicketConsumeResult


WsTicketStore

Re-exports WsTicketStore


WsTicketStoreOptions

Re-exports WsTicketStoreOptions


WsUpgradeOptions

Re-exports WsUpgradeOptions