Primitives / API
foldkit-primitives/net
Namespaces
SharedHost | One server in the browser for many documents: every tab and frame of an application meets the same host. A page opens conversations, each a MessagePort with… |
Functions
broadcastMessages | Every post to name from another channel, as Messages. Without a BroadcastChannel API the stream is empty instead of throwing; closing the stream closes the… |
isLive | Whether the stream is live: open with no error outstanding. The browser reconnects a dropped stream itself; a Failed only records the error. |
isOpen | Whether the socket is usable: open with no error outstanding. Gates sends and received frames. |
postBroadcast | Posts one message to name. Opens a channel, posts, and closes it: the send is one-shot, so it is a Command, not a resource. Without a BroadcastChannel API —… |
sse | Server-sent events as a bundle: connection lifecycle in the Model, the event stream through one Managed Resource. One-directional, so there is no send: the… |
viewOf | The view of a socket, and whether its page still wants it. An error stands until the page stops wanting the socket; a retry still waiting for its socket… |
viewOfSse | The view of a stream, and whether its page still wants it. An error stands until the page stops wanting the stream; a retry still waiting for its stream… |
websocket | A WebSocket as a bundle: connection lifecycle in the Model, full duplex through one Managed Resource. The resource owns the socket; a send helper writes… |
Values
BroadcastMessage | |
Online | Online presence as a bundle: online in the Model, kept current by the window's online/offline events. The browser reports facts; the Model owns the state,… |
OnlineMessage | |
OnlineModel | |
Socket | The live connection, for send and the incoming stream. One assembly holds one. |
SocketView | What the reader sees: the socket's state, or its error. A page derives this instead of keeping its own connection state machine. lastError is already worded… |
Source | The live stream, for the incoming subscription. One assembly holds one. |
SseMessage | |
SseModel | |
SseView | What the reader sees: the stream's state, or its error. A page derives this instead of keeping its own connection state machine. lastError carries the… |
WebSocketMessage | |
WebSocketModel | |
Interfaces
Acquired | The registry value behind the socket tag: the live socket and its incoming queue. |
AcquiredSource | The registry value behind the source tag: the live source and its incoming queue. |
BroadcastChannelHandle | The slice of a BroadcastChannel this module needs; satisfied by the platform class. |
Conversation | One conversation a page opened: its port, and a signal that aborts once the page is gone. |
SharedHostConnection | A page's way to the host. |
SharedHostOptions | Where SharedHost runs the host: in a SharedWorker, or in the page when there is none. |
SocketHandle | The slice of a WebSocket the bundle needs; satisfied by the platform socket and test doubles. Handler events are any: the DOM and ws type them differently,… |
SourceHandle | The slice of an EventSource the bundle needs; satisfied by the platform class. |
Types
ConversationHandler | What the host does with each conversation, told what the page opened it for. |
SocketService | The socket service a placed WebSocket's streams and send commands require. |
SourceService | The source service a placed SSE stream requires. |
StartHost | Starts the host, once, the first time a conversation needs it. |