Class: Glottis::Handlers::RemoteInputHandler
- Inherits:
-
Thread
- Object
- Thread
- Glottis::Handlers::RemoteInputHandler
- Defined in:
- lib/glottis/handlers/remote_input_handler.rb
Overview
This class manages a TCP connection with a valyx server.
Constant Summary collapse
- PROTOCOL =
'http'.freeze
- STREAM_DELIMITER =
"\0".freeze
- READ_TIMEOUT =
this needs to be high
3600
- REMOTE_PATHS =
{ get_message_stream: '/api/messages/stream' }.freeze
Instance Method Summary collapse
- #cleanup ⇒ Object
-
#initialize(incoming, host, port) ⇒ RemoteInputHandler
constructor
A new instance of RemoteInputHandler.
Constructor Details
#initialize(incoming, host, port) ⇒ RemoteInputHandler
Returns a new instance of RemoteInputHandler.
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/glottis/handlers/remote_input_handler.rb', line 17 def initialize(incoming, host, port) @incoming = incoming @host = host @port = port setup_http super do @http.start read_loop end end |
Instance Method Details
#cleanup ⇒ Object
30 31 32 |
# File 'lib/glottis/handlers/remote_input_handler.rb', line 30 def cleanup @http.finish if @http.started? end |