Class: Ably::Realtime::Presence::PresenceManager Private

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/ably/realtime/presence/presence_manager.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

PresenceManager is responsible for all actions relating to presence state

This is a private class and should never be used directly by developers as the API is likely to change in future.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(presence) ⇒ PresenceManager

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of PresenceManager.



16
17
18
19
20
# File 'lib/ably/realtime/presence/presence_manager.rb', line 16

def initialize(presence)
  @presence = presence

  setup_channel_event_handlers
end

Instance Attribute Details

#presenceAbly::Realtime::Presence (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Ably::Realtime::Presence this Manager is associated with



14
15
16
# File 'lib/ably/realtime/presence/presence_manager.rb', line 14

def presence
  @presence
end

Instance Method Details

#sync_expectedvoid

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Expect SYNC ProtocolMessages from the server with a list of current members on this channel



27
28
29
# File 'lib/ably/realtime/presence/presence_manager.rb', line 27

def sync_expected
  presence.members.change_state :sync_starting
end

#sync_not_expectedvoid

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

There server has indicated that there are no SYNC ProtocolMessages to come because there are no members on this channel



37
38
39
# File 'lib/ably/realtime/presence/presence_manager.rb', line 37

def sync_not_expected
  presence.members.change_state :in_sync
end