Module: CableRoom::RoomMember

Extended by:
ActiveSupport::Concern
Included in:
RoomProxyChannel
Defined in:
lib/cable_room/room_member.rb

Constant Summary collapse

PING_INTERVAL =

How often a silent member reminds its room that it is alive. A member that has sent anything within this interval skips the ping (the room counts every inbound message as activity), so the room hears from a live member at least every 2 x PING_INTERVAL — which must stay under Room::PortManagement::PORT_TIMEOUT with margin for queue lag. Pings were ~30% of all room messages at 10 s with no skipping.

15.seconds
REANNOUNCE_INITIAL_DELAY =

A dropped announcement is invisible to the port. The room's inbound subscription is registered asynchronously — and the room may live in another process entirely — so a port_connected sent before the room is listening is discarded with no error. Re-announce on a doubling backoff from here until the room acknowledges, rather than waiting out a whole PING_INTERVAL. port_connected is idempotent on the room side (the port is merged, user_joined fires only once), so a redundant re-announcement costs one message.

0.1.seconds

Instance Method Summary collapse

Instance Method Details

#_room_memberships ⇒ Object



30
31
32
# File 'lib/cable_room/room_member.rb', line 30

def _room_memberships
  @_room_memberships ||= Set.new
end