Expand description
v0.104 (real-time track slice 3b): shared analysis of a from websocket
on open handler for the Workers wire path.
On Workers the upgrade is authenticated at the edge, then forwarded to the
Durable Object that hosts the connection — the agent the on open
transfers it to. For that routing to be static, the handler must transfer the
connection to exactly one agent, by a key derivable from the request (D2).
This module finds that single transfer; both the checker (to diagnose a bad
shape) and the emitter (to route the upgrade) use it.
Lives in bynk-check (moved here in the compiler-pipeline-review’s Wave
5, batch 5.1) rather than bynk-emit: it depends only on bynk-syntax’s
AST and is conceptually checker-side analysis, misfiled under the emitter.
Structs§
- WsOpen
Target - The single connection-transfer target a
from websocketon openresolves to: the agent that will host the connection, and the key expression addressing the instance (Room(roomId)→ agentRoom, keyroomId).
Enums§
- WsOpen
Shape - The shape of an
on openbody’s connection handling (D2).
Constants§
- CONNECTION_
BINDING - The synthetic name of the held connection an
on openhandler receives.
Functions§
- analyse_
open_ shape - Analyse a
from websocketon openbody: find the top-level agent transfers of theconnectionbinding (alet _ <- Agent(key).m(…, connection)statement). A transfer nested in a conditional is deliberately not counted — the host DO must be statically resolvable.