Class: Synapse::EventBus::EventBus Abstract
- Inherits:
-
Object
- Object
- Synapse::EventBus::EventBus
- Defined in:
- lib/synapse/event_bus/event_bus.rb
Overview
This class is abstract.
Represents a mechanism for event listeners to subscribe to events and for event publishers to dispatch their events to any interested parties.
Implementations may or may not dispatch the events to listeners in the dispatching thread.
Direct Known Subclasses
Instance Method Summary collapse
-
#publish(*events) ⇒ undefined
abstract
Publishes one or more events to any listeners subscribed to this event bus.
-
#subscribe(listener) ⇒ undefined
abstract
Subscribes the given listener to this event bus.
-
#unsubscribe(listener) ⇒ undefined
abstract
Unsubscribes the given listener from this event bus.
Instance Method Details
#publish(*events) ⇒ undefined
This method is abstract.
Publishes one or more events to any listeners subscribed to this event bus
Implementations may treat the given events as a single batch and distribute them as such to all subscribed event listeners.
18 |
# File 'lib/synapse/event_bus/event_bus.rb', line 18 def publish(*events); end |
#subscribe(listener) ⇒ undefined
This method is abstract.
Subscribes the given listener to this event bus
26 |
# File 'lib/synapse/event_bus/event_bus.rb', line 26 def subscribe(listener); end |
#unsubscribe(listener) ⇒ undefined
This method is abstract.
Unsubscribes the given listener from this event bus
33 |
# File 'lib/synapse/event_bus/event_bus.rb', line 33 def unsubscribe(listener); end |