Class: TinyQ::ClientConnection
- Inherits:
-
EventMachine::Connection
- Object
- EventMachine::Connection
- TinyQ::ClientConnection
- Includes:
- EventMachine::Protocols::LineText2
- Defined in:
- lib/tinyq/client.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
Instance Method Summary collapse
-
#initialize ⇒ ClientConnection
constructor
A new instance of ClientConnection.
- #receive_line(message) ⇒ Object
Constructor Details
#initialize ⇒ ClientConnection
Returns a new instance of ClientConnection.
7 8 9 |
# File 'lib/tinyq/client.rb', line 7 def initialize set_delimiter TinyQ::DELIMITER end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
5 6 7 |
# File 'lib/tinyq/client.rb', line 5 def client @client end |
Instance Method Details
#receive_line(message) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/tinyq/client.rb', line 11 def receive_line begin reply = JSON.parse() @client.callbacks.each { |c| c.call(reply) } rescue Exception => e puts e end end |