Class: Mantle::MessageHandlers
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Mantle::MessageHandlers
- Defined in:
- lib/mantle/message_handlers.rb
Instance Method Summary collapse
- #channels ⇒ Object
-
#initialize(hash_instance = {}) ⇒ MessageHandlers
constructor
A new instance of MessageHandlers.
- #receive_message(channel, message) ⇒ Object
Constructor Details
#initialize(hash_instance = {}) ⇒ MessageHandlers
Returns a new instance of MessageHandlers.
5 6 7 |
# File 'lib/mantle/message_handlers.rb', line 5 def initialize(hash_instance = {}) super hash_instance end |
Instance Method Details
#channels ⇒ Object
17 18 19 |
# File 'lib/mantle/message_handlers.rb', line 17 def channels keys end |
#receive_message(channel, message) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/mantle/message_handlers.rb', line 9 def (channel, ) Array(fetch(channel)).each do |string_handler| Mantle::Workers::MessageHandlerWorker.perform_async( string_handler, channel, ) end end |