Skip to main content

Module surface_services

Module surface_services 

Expand description

The session’s services as a surface app reaches them.

The bar, the desk, the panels and the sheets are ordinary apps of the session that places their windows, and they read what the session publishes the way every app does: crate::collaboration::SessionResource over a connection the session’s broker admits for their launch. What differs is only how the connection arrives — the launcher hands an app a connected descriptor, while a surface app is started by the session itself, which names the socket and the launch on its environment (SOCKET_ENV, APP_ID_ENV, WORKSPACE_ENV). The app connects that socket and says which launch it is, exactly as the launcher does on its behalf, and the broker attests it by the process it started.

connect runs once, before the app’s window opens. A process that is no surface connects nothing: an app started by the launcher already holds its connection, and a process started by hand has no session to reach.

The session records the launch of the surface it starts before the app may reach it, and releases it only then (runtime_portal::registration_gate): connect waits for that release, so its connection is never ahead of the record the broker attests it by.

Constants§

ACTIONS_FD_ENV
The environment variable naming the descriptor on which a surface app talks to the session that places it.
APP_ID_ENV
The app the session started this surface as: what the broker admits its launch by, and what its catalogue rows are published under.
SOCKET_ENV
The socket the session serves its services on, as a surface app reaches it: what the session names when it serves one.
WORKSPACE_ENV
The workspace the session started this surface in: the workspace its launch names.

Functions§

connect
Connect this surface app to its session’s services, if it is one: the session’s published resources and the actions on them are reached from here on as any app reaches them.
is_surface
Whether this process is a surface app’s, as the session that started it says: a surface is handed the actions socket the session answers on.