Class: Hokaido::Watcher
- Inherits:
-
Object
- Object
- Hokaido::Watcher
- Includes:
- Celluloid, Celluloid::Notifications
- Defined in:
- lib/hokaido/watcher.rb
Instance Method Summary collapse
-
#initialize(socket) ⇒ Watcher
constructor
A new instance of Watcher.
- #received(topic, chunk) ⇒ Object
Constructor Details
#initialize(socket) ⇒ Watcher
Returns a new instance of Watcher.
9 10 11 12 13 |
# File 'lib/hokaido/watcher.rb', line 9 def initialize(socket) @socket = socket subscribe 'broadcast', :received end |
Instance Method Details
#received(topic, chunk) ⇒ Object
15 16 17 |
# File 'lib/hokaido/watcher.rb', line 15 def received(topic, chunk) @socket.write chunk end |