Joining presence

Join a Space's presence, or the presence of a window another Space shows, so each viewer is one avatar and one cursor.

join_presence joins the Space's channel. join_presence_for takes the window being watched: a window another Space shows here, streamed straight from its origin, joins the origin's channel and this Space's and reads them as one. The types are on Streams and presence.

Joining presence#

Methods of Space.

Space.join_presence#

Joins presence. Waits up to timeout_ms (default 10 s) for the roster.

async def join_presence(self, identity: PresenceIdentity, timeout_ms: Optional[int]) -> SpacePresence
ParameterTypeDefault
identityPresenceIdentityrequired
timeout_msOption<u64>required

Returns SpacePresence · Async · Raises CuaError

Space.join_presence_for#

Joins presence for the window being watched. For a window another Space shows here and the viewer streams straight from its origin (window_id from Space.windows), this joins the origin's channel and this Space's, publishes the cursor to both and reads them as one: one avatar and one cursor per viewer, as if the stream came through this Space. For any other window, or None, it is Space.join_presence.

async def join_presence_for(self, window_id: Optional[str], identity: PresenceIdentity, timeout_ms: Optional[int]) -> SpacePresence
ParameterTypeDefault
window_idOption<String>required
identityPresenceIdentityrequired
timeout_msOption<u64>required

Returns SpacePresence · Async · Raises CuaError