Expand description
The Arora Bridge interface.
A Bridge connects an Arora runtime to a remote — in practice Semio Studio
over studio-bridge. It is modelled on studio-bridge’s device-client
trait: push local state changes out, receive device-info updates and
commands in, and learn when a client is asking for data.
§The seam: an owned inbound stream, a non-blocking outbound push
A Bridge value is an endpoint: the connection as seen by exactly one
device, owned by exactly one runtime. Its data plane is two methods:
take_inboundhands over the endpoint’s inbound event stream — once, at assembly. The runtime owns the stream from then on and polls it from its own loop (nativelyrun’s select drains it between steps; on the web the per-frame sweep does). The stream ending means the endpoint disconnected; the runtime maps that explicitly, it is never silent.try_sendpushes an outboundStateChangetoward the remote, now, without blocking (a channel send / synchronous put).
Exclusive ownership is the point: one poller per endpoint, so there is no shared receiver and no lock anywhere on the data plane. An implementation whose transport genuinely serves several devices (one Zenoh session, one WebSocket server) keeps that transport in a shared core and hands out one endpoint per device, demuxing inbound events to the right endpoint’s stream — share the core, not the endpoint.
The trait depends on futures-core (for Stream) but on no async
runtime:
native impls may feed the stream from their own tokio task, web impls from
browser events; the runtime only polls.
The trait lives here (lean: arora-types + stream primitives) so the
runtime can depend on the interface without depending on studio-bridge.
studio-bridge keeps its device-client implementations and implements this
trait on them.
Structs§
- Access
Request - A remote client asking permission to interact with the device — e.g. a Studio client wanting to join the device’s session (Studio’s “session joining access control”).
- Bridge
Command - A command received from the remote, carrying a one-shot reply channel.
- Device
Info - Neutral device metadata the bridge syncs with the remote. The bridge-flavored
wire form (studio-bridge’s
PartialDeviceInfo) is converted to/from this by the connector. - Fake
Bridge - A no-op
Bridgefor tests and offline runs: never registers, never emits inbound events (its stream never yields — the endpoint never disconnects), and accepts (drops) any data sent.
Enums§
- Access
Decision - The device operator’s answer to an
AccessRequest. - Bridge
Error - Something went wrong on the bridge.
- Bridge
Op - An operation a remote client asks the device to perform. Mirrors
studio-bridge’s
AroraOp. - Inbound
- An inbound event on a bridge endpoint, yielded by the stream
Bridge::take_inboundhands over.
Traits§
- Bridge
- One device’s connection to a remote (e.g. Semio Studio) — an endpoint, owned by exactly one runtime.
- Caller
- The client side of calling a device — the counterpart of a
Bridgeendpoint: carry a fully-specifiedCallto a device and resolve on its reply. A device applies external calls at a step boundary, so calling is asynchronous by nature wherever the device lives — in the same process or across a transport.
Type Aliases§
- Access
Request Stream - Stream of access requests from remote clients.
- Bridge
Result - Call
Future - A
Caller’s pending reply. - Inbound
Stream - The inbound event stream of one bridge endpoint. Owned: whoever takes it is the endpoint’s one poller. The stream ending means the endpoint disconnected.