Skip to main content

Module broker

Module broker 

Source
Expand description

How an app gets its channel to its workspace’s render service.

The launcher connects the session’s render broker ($XDG_RUNTIME_DIR/tilo/services/render.sock) on the app’s behalf and writes handshake — the app and its workspace — before the sandboxed app holds the connection, then hands it in as TILO_SVC_RENDER_FD. The app asks on it for a channel (request_channel): one byte out, one byte and the channel’s descriptor back. It asks again when a channel breaks (the service restarted), and once per window, so every window renders on a channel of its own.

The broker, not the app, chose the workspace: the app can only ever reach the service of the workspace it was launched into.

Structs§

Handshake

Constants§

FD_ENV
The app’s connection to the broker, as the launcher hands it in.
MAX_HANDSHAKE
Longest handshake line the broker reads.
PROTOCOL
Version of the handshake line.
SERVICE
The service name: the broker’s socket is services/render.sock, and the app finds its connection in TILO_SVC_RENDER_FD.
SOCKET_ENV
For a process outside the sandbox (a developer’s run, a measurement): the broker’s socket to connect itself, writing its own handshake.

Functions§

answer
Answer a request with channel, or refuse it.
handshake
The line that names an app and its workspace on a new broker connection.
read_handshake
read_request
Wait for the next request on a broker connection. Ok(false) at end of stream.
request_channel
Ask the broker on broker for a channel. Blocks until it answers.
write_handshake