Class: Hokaido::Watcher

Inherits:
Object
  • Object
show all
Includes:
Celluloid, Celluloid::Notifications
Defined in:
lib/hokaido/watcher.rb

Instance Method Summary collapse

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