Skip to main content
Version: 0.8.0

Attaching

A client attaches to a channel by opening it: the live connection in the typed projection, /v1/events in the browser projection. Attaching is what the Core counts, establishes and keeps an eye on.

How many clients​

Cardinality is declared per channel, and has no default.

clientsThe channel admitsA further connection
singleone clientrefused with channel.in_use, naming nothing about who holds it
multipleas many as connectaccepted
  • A single-client channel refuses the second connection and never displaces the first.
  • Cardinality and arbitration compose without interacting: cardinality decides how many clients may hold one channel, arbitration decides which channels may act while others are live, and the grade of a suspension decides what a losing channel keeps.

Who the client is​

What establishes the client is the class of the channel's address, and never anything the client states.

ClassEstablished fromIf nothing establishes one
local socketthe kernel's peer credential, resolved through the host's account database—
loopbacknothing: the kernel has nothing to say about the peerthe client is recorded as unestablished, and the channel is a declared weaker configuration
routablethe credential the class requiresthe connection is refused with auth.required or auth.invalid
  • The established client is what channel.attached carries, and the same value channel.detached names later.
  • No operation carries a client identity, at any level.
  • A managed interface attaches like any other client: established by the class of its channel's address and counted against the same cardinality. Being launched by the Core grants it nothing here.

The opening picture​

A channel is given a snapshot when it attaches, before anything else.

The opening picture carriesSo that the client can
what this channel may address — the units, and the streams, commands and questions each exposesrender itself without a second call
the current state of each of those subjectsshow the instrument as it is, not as it becomes
the channel's own state — attached, and whether it is suspended and in which gradeknow whether what it shows is live and whether its controls act
the identity of the standing subscription, and the sequence the snapshot was taken atnarrow the filter, and join the stream of changes exactly
the contract version the Core speaksfail early rather than at the first operation it cannot express

The picture is the same record a read returns and a subscription opens with (what a channel sees).

What ends an attachment​

CauseWhat the Core does
the client closeschannel.detached, reason closed
the transport is lostchannel.detached, reason lost — at once when the connection ends without the client closing it, since the client can no longer be reached; and, while the connection still looks open, once liveness concludes it (below)
a managed interface's process endsits connection closes with it; the channel is detached
the instance stopschannels stop accepting, and drain what they carry
  • Arbitration is recomputed on every one of them, so nothing stays suspended in favour of a channel nobody holds. The detachment is announced first: a channel.resumed it causes follows the channel.detached that caused it.
  • Detaching leaves nothing behind. Subscriptions end with the connection, stream deliveries are released, and a client that returns attaches afresh and is given a new opening picture. Nothing about an attachment is persisted, and a Core that restarts ends every one it had.

A connection that looks open proves nothing​

An unplugged cable or a suspended laptop can leave a socket that looks connected for a long time. So a client's liveness is its confirmed subscription (a subscription).

Who must confirma client on a channel named in any arbitration rule — computed from the declaration, never declared beside it
What it acknowledgesa sequence: the last event it has processed
How often, and when it is staleevery 10 s; stale after 3 missed intervals
What being stale produceschannel.subscription.stale, an ordinary event about the channel, which arbitration reads
What it does not producebuffering — a client that stopped confirming is not held for, and its return is a fresh snapshot

Confirming is required, not offered. It bounds how long a client that is not showing reality can hold a machine's controls; it does not promise delivery.