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 19 20 |
# File 'lib/synapse/event_bus/event_bus.rb', line 18 def publish(*events) raise NotImplementedError end |
#subscribe(listener) ⇒ undefined
This method is abstract.
Subscribes the given listener to this event bus
28 29 30 |
# File 'lib/synapse/event_bus/event_bus.rb', line 28 def subscribe(listener) raise NotImplementedError end |
#unsubscribe(listener) ⇒ undefined
This method is abstract.
Unsubscribes the given listener from this event bus
37 38 39 |
# File 'lib/synapse/event_bus/event_bus.rb', line 37 def unsubscribe(listener) raise NotImplementedError end |