Class: LocalBus
- Inherits:
-
Object
- Object
- LocalBus
- Includes:
- Singleton
- Defined in:
- lib/local_bus.rb,
lib/local_bus/bus.rb,
lib/local_bus/message.rb,
lib/local_bus/station.rb,
lib/local_bus/version.rb,
lib/local_bus/subscriber.rb,
lib/local_bus/publication.rb
Defined Under Namespace
Classes: Bus, Message, Publication, Station, Subscriber
Constant Summary collapse
- VERSION =
"0.3.1"
Instance Attribute Summary collapse
-
#bus ⇒ Object
readonly
Default Bus instance.
-
#station ⇒ Object
readonly
Default Station instance.
Class Method Summary collapse
-
.publish ⇒ Object
Publishes a message via the default Station.
-
.publish_message ⇒ Object
Publishes a pre-built message via the default Station.
-
.subscribe ⇒ Object
Subscribe to a topic via the default Station.
-
.unsubscribe ⇒ Object
Unsubscribes a callable from a topic via the default Station.
-
.unsubscribe_all ⇒ Object
Unsubscribes all subscribers from a topic and removes the topic via the default Station.
Instance Attribute Details
#bus ⇒ Object (readonly)
Default Bus instance
22 23 24 |
# File 'lib/local_bus.rb', line 22 def bus @bus end |
#station ⇒ Object (readonly)
Default Station instance
26 27 28 |
# File 'lib/local_bus.rb', line 26 def station @station end |
Class Method Details
.publish ⇒ Object
Publishes a message via the default Station
36 37 38 |
# File 'lib/local_bus.rb', line 36 def publish(...) instance.station.publish(...) end |
.publish_message ⇒ Object
Publishes a pre-built message via the default Station
43 44 45 |
# File 'lib/local_bus.rb', line 43 def (...) instance.station.(...) end |
.subscribe ⇒ Object
Subscribe to a topic via the default Station
52 53 54 |
# File 'lib/local_bus.rb', line 52 def subscribe(...) instance.station.subscribe(...) end |
.unsubscribe ⇒ Object
Unsubscribes a callable from a topic via the default Station
60 61 62 |
# File 'lib/local_bus.rb', line 60 def unsubscribe(...) instance.station.unsubscribe(...) end |
.unsubscribe_all ⇒ Object
Unsubscribes all subscribers from a topic and removes the topic via the default Station
67 68 69 |
# File 'lib/local_bus.rb', line 67 def unsubscribe_all(...) instance.station.unsubscribe_all(...) end |