Python SDK — Room Updates

Room updates are the reliable event lane: submit named actions, then poll for broadcasts and pending requests. Keep the returned cursor so each client sees every update exactly once, across reconnects.

Room Updates — client.updates

send
client.updates.send(
    player_token: str,
    type: str,
    data: Any = None,
    target_players: RoomTargetPlayers = RoomTargetPlayers.ALL,
    target_players_ids: list[int] | None = None,
) -> UpdatePlayersResponse

Sends an update to specific players or all players in the room.

poll
client.updates.poll(
    player_token: str,
    from_players: RoomTargetPlayers = RoomTargetPlayers.HOST,
    from_players_ids: list[int] | None = None,
    last_update: str | None = None,
    data_cls: type | None = None,
) -> PollUpdatesResponse

Polls for updates sent to the current player, optionally filtered by source players and last_update id.

Durable per-player room state

Room updates are the durable state lane: send writes a typed update — position, loadout, ready flag, board state — addressed to a target set, and it persists for late joiners instead of evaporating like an ephemeral message. Latest value wins: write the current state, not a history.

Poll reads updates since the last cursor you stored, optionally filtered by source players. Keep the returned cursor per client so every update is delivered exactly once — across reconnects and rejoins, which is what makes the lane reliable.

  • Updates for durable state, actions for requests that need answers, realtime for high-frequency ephemeral events.
  • Keep payloads small and typed — every member polls them on a cadence.
  • Store the cursor client-side; restarting from zero replays the whole room history.
  • Calls are synchronous functions — wrap them in asyncio.to_thread or your engine's job system when the game loop cannot block, and reuse one client across coroutines.