Expand description
The WebSocket Event I/O Processor: the frames both ends speak and the delivery state of one
peer link, shared by the browser shell (vertep-wasm) and the server endpoint
([server], feature websocket).
Frames are JSON text messages tagged by type:
hello(client to server, first frame): the client’s node IRI, the credential its provider supplied, and the IRI prefixes of the actors it hosts.welcomeorrefused(server to client): the connection is accepted, or its credential is refused (the server then closes it).message: a Vertep envelope: message id, target IRI, origin IRI, event name, payload, send id and correlation id.ack: the receiver accepted the message with that id into a mailbox.
Delivery is at least once. A Link keeps every message it sent until the peer
acknowledges it and sends all of them again after a reconnect; receivers deduplicate by
message id (the runtime journals message ids and drops a duplicate, see
[[openspec:event-journal#Message Deduplication]]).
The runtime’s transactional outbox holds a send until delivery succeeds: a send offered to a
LinkMailbox is refused with “awaiting acknowledgement” until the peer’s ack arrives, so
the outbox retries it and its durable outbox mark passes it only once it is acknowledged.
That makes the redelivery survive a crash of the sender, too.
Structs§
- Client
Resolver - Resolves the addresses a client sends to over its one
Linkto the server: every address (of the schemes it is registered for) that starts with one oftargets, or every address whentargetsis empty. Addresses hosted locally never reach a resolver. - Link
- The delivery state of one peer: the unacknowledged messages, the current connection, and
the acknowledgements received. It outlives connections, so a reconnect sends every pending
message again. It is
Send + Sync; the I/O lives in the connection code, which hands the link a channel of outgoing frame texts on connect. - Link
Mailbox - The runtime’s view of an actor reached through a
Link: a mailbox that offers each message to the link. It accepts a message once the peer acknowledged it; until then it reports the delivery as failed, so the outbox keeps the send and retries it. A send refused by the peer’s credential check is recorded as a dead letter (reasontransport-refused) and settled. - Message
- A Vertep envelope on the wire.
- WebSocket
Transport - The WebSocket Event I/O Processor as a runtime transport (
<send type="websocket">or its type IRI). It delivers into the mailbox the address resolved to, which for a remote actor is aLinkMailbox;_ioprocessorslists it.
Enums§
- Frame
- One frame of the protocol.
- Inbound
- What the receiving side of a
Linkshould do with a frame. - Offer
- What became of a message offered to a
Link.
Constants§
- REFUSED_
REASON - The dead-letter reason of a send whose connection credential was refused.
- WEBSOCKET_
PROCESSOR - The type IRI of the WebSocket Event I/O Processor (alias
websocket). Events that arrive over WebSocket carry it as_event.origintype.