Class: EvilEvents::Core::System::Broadcaster Private
- Inherits:
-
Object
- Object
- EvilEvents::Core::System::Broadcaster
- Defined in:
- lib/evil_events/core/system/broadcaster.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.
Instance Attribute Summary collapse
- #adapters_container ⇒ EvilEvents::Core::Broadcasting::Adapters readonly private
- #event_emitter ⇒ EvilEvents::Core::Broadcasting::Emitter readonly private
- #event_notifier ⇒ EvilEvents::Core::Events::Notifier::Abstract readonly private
Instance Method Summary collapse
-
#emit(event, adapter: nil) ⇒ Object
private
Void.
-
#initialize ⇒ Broadcaster
constructor
private
A new instance of Broadcaster.
-
#process_event_notification(manager, event) ⇒ Object
private
Void.
-
#raw_emit(event_type, id: nil, payload: {}, metadata: {}, adapter: nil) ⇒ Object
private
Void.
-
#register_adapter(adapter_name, adapter_object) ⇒ Object
private
Void.
- #resolve_adapter(adapter_name) ⇒ EvilEvents::Core::Broadcasting::Dispatcher::Dispatchable private
-
#restart_event_notifier ⇒ Object
private
Void.
Constructor Details
#initialize ⇒ Broadcaster
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 Broadcaster.
23 24 25 26 27 28 29 |
# File 'lib/evil_events/core/system/broadcaster.rb', line 23 def initialize @adapters_container = EvilEvents::Core::Broadcasting::Adapters.new @event_emitter = EvilEvents::Core::Broadcasting::Emitter.new @event_notifier = EvilEvents::Core::Events::Notifier::Proxy.new @adapters_container.register_core_adapters! end |
Instance Attribute Details
#adapters_container ⇒ EvilEvents::Core::Broadcasting::Adapters (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.
15 16 17 |
# File 'lib/evil_events/core/system/broadcaster.rb', line 15 def adapters_container @adapters_container end |
#event_emitter ⇒ EvilEvents::Core::Broadcasting::Emitter (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.
10 11 12 |
# File 'lib/evil_events/core/system/broadcaster.rb', line 10 def event_emitter @event_emitter end |
#event_notifier ⇒ EvilEvents::Core::Events::Notifier::Abstract (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.
20 21 22 |
# File 'lib/evil_events/core/system/broadcaster.rb', line 20 def event_notifier @event_notifier end |
Instance Method Details
#emit(event, adapter: nil) ⇒ Object
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 void.
36 37 38 |
# File 'lib/evil_events/core/system/broadcaster.rb', line 36 def emit(event, adapter: nil) event_emitter.emit(event, adapter: adapter) end |
#process_event_notification(manager, event) ⇒ Object
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 void.
76 77 78 |
# File 'lib/evil_events/core/system/broadcaster.rb', line 76 def process_event_notification(manager, event) event_notifier.notify(manager, event) end |
#raw_emit(event_type, id: nil, payload: {}, metadata: {}, adapter: nil) ⇒ Object
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 void.
48 49 50 51 52 |
# File 'lib/evil_events/core/system/broadcaster.rb', line 48 def raw_emit(event_type, id: nil, payload: {}, metadata: {}, adapter: nil) event_emitter.raw_emit( event_type, id: id, payload: payload, metadata: , adapter: adapter ) end |
#register_adapter(adapter_name, adapter_object) ⇒ Object
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 void.
67 68 69 |
# File 'lib/evil_events/core/system/broadcaster.rb', line 67 def register_adapter(adapter_name, adapter_object) adapters_container.register(adapter_name, adapter_object) end |
#resolve_adapter(adapter_name) ⇒ EvilEvents::Core::Broadcasting::Dispatcher::Dispatchable
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.
58 59 60 |
# File 'lib/evil_events/core/system/broadcaster.rb', line 58 def resolve_adapter(adapter_name) adapters_container.resolve(adapter_name) end |
#restart_event_notifier ⇒ Object
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 void.
83 84 85 |
# File 'lib/evil_events/core/system/broadcaster.rb', line 83 def restart_event_notifier event_notifier.restart! end |