Presence

The Participants List user interface component uses django-channels-presence for keeping track of all the currently connected participants of a poker session. Every user sends a 'heartbeat' event every 20 seconds via their Client-Side consumer to the server which signals that they’re are still participating in the poker session which then updates a timestamp in the database. Any stale connection, which can occur whenever a client closes a connection improperly (e.g. by losing connection to the server) have to be regularly pruned in order to accurately display the list of active participants. See the Pruning stale connections section at the django-channels-presence docs for possible ways to prune stale connections.

Receivers

broadcast_presence(room: channels_presence.models.Room, **kwargs)[source]

Broadcast the new list of present users to the PokerConsumers.

Parameters

room – The room from which a presence was added or removed.