Class: CelluloidPubsub::Registry

Inherits:
Object
  • Object
show all
Defined in:
lib/celluloid_pubsub/registry.rb

Overview

class used to register new channels and save them in memory

Class Attribute Summary collapse

Instance Attribute Summary collapse

Class Attribute Details

.channelsArray<String>

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.

holds a list of all known channels

Returns:

  • (Array<String>)


36
37
38
# File 'lib/celluloid_pubsub/registry.rb', line 36

def channels
  @channels ||= []
end

.messagesHash<String, Array<Hash>>

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.

holds a list of all messages sent by clients that were not published to a channel because there were no subscribers at that time

The keys are the channel names and the values are arrays of messages

Returns:

  • (Hash<String, Array<Hash>>)


27
28
29
# File 'lib/celluloid_pubsub/registry.rb', line 27

def messages
  @messages ||= {}
end

Instance Attribute Details

#channelsArray, Object

Returns:

  • (Array)

    array of channels to which actors have subscribed to

  • (Object)

    the current value of channels



8
9
10
# File 'lib/celluloid_pubsub/registry.rb', line 8

def channels
  @channels
end