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(operation, options = {}) ⇒ Object
Sends a Lightstreamer control request that executes the specified operation 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.
-
#subscription_execute(operation, table, options = {}) ⇒ Object
Sends a Lightstreamer subscription control request with the specified operation, table, and options.
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(operation, options = {}) ⇒ Object
Sends a Lightstreamer control request that executes the specified operation with the specified options. If an error occurs then an Error subclass will be raised.
19 20 21 22 23 |
# File 'lib/lightstreamer/control_connection.rb', line 19 def execute(operation, = {}) result = execute_post_request build_payload(operation, ) raise Error.build(result[2], result[1]) if result.first != 'OK' end |
#subscription_execute(operation, table, options = {}) ⇒ Object
Sends a Lightstreamer subscription control request with the specified operation, table, and options. If an error occurs then an Error subclass will be raised.
39 40 41 42 43 44 45 |
# File 'lib/lightstreamer/control_connection.rb', line 39 def subscription_execute(operation, table, = {}) [:table] = table operation, execute operation, end |