Class: EventedBluepill::Socket::CmdListenerConnection
- Inherits:
-
Coolio::UNIXSocket
- Object
- Coolio::UNIXSocket
- EventedBluepill::Socket::CmdListenerConnection
- Defined in:
- lib/evented_bluepill/socket.rb
Instance Method Summary collapse
-
#initialize(socket, application) ⇒ CmdListenerConnection
constructor
A new instance of CmdListenerConnection.
- #on_read(data) ⇒ Object
Constructor Details
#initialize(socket, application) ⇒ CmdListenerConnection
Returns a new instance of CmdListenerConnection.
11 12 13 14 |
# File 'lib/evented_bluepill/socket.rb', line 11 def initialize(socket, application) @application = application super(socket) end |
Instance Method Details
#on_read(data) ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/evented_bluepill/socket.rb', line 16 def on_read(data) command, *args = data.strip.split(":") response = begin @application.send(command, *args) rescue Exception => e e end write(Marshal.dump(response)) end |