Class: Lightstreamer::ControlConnection
- Inherits:
-
Object
- Object
- Lightstreamer::ControlConnection
- Defined in:
- lib/lightstreamer/control_connection.rb
Overview
This is an internal class used by Session and is responsible for sending Lightstreamer control requests.
Instance Method Summary collapse
-
#execute(options) ⇒ Object
Sends a Lightstreamer control request with the specified options.
-
#initialize(session_id, control_url) ⇒ ControlConnection
constructor
Initializes this class for sending Lightstreamer control requests using the specified session ID and control address.
Constructor Details
#initialize(session_id, control_url) ⇒ ControlConnection
Initializes this class for sending Lightstreamer control requests using the specified session ID and control address.
9 10 11 12 |
# File 'lib/lightstreamer/control_connection.rb', line 9 def initialize(session_id, control_url) @session_id = session_id @control_url = URI.join(control_url, '/lightstreamer/control.txt').to_s end |
Instance Method Details
#execute(options) ⇒ Object
Sends a Lightstreamer control request with the specified options. If an error occurs then RequestError or ProtocolError will be raised.
26 27 28 29 30 |
# File 'lib/lightstreamer/control_connection.rb', line 26 def execute() result = execute_post_request build_payload() raise ProtocolError.new(result[2], result[1]) if result.first == 'ERROR' end |