Module: Gauge::Runtime Private
- Defined in:
- lib/gauge_runtime.rb
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Constant Summary collapse
- DEFAULT_IMPLEMENTATIONS_DIR_PATH =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Util.get_step_implementation_dir
Class Method Summary collapse
- .dispatch_messages(socket) ⇒ Object private
- .handle_message(socket, message) ⇒ Object private
- .port_from_env_variable(env_variable) ⇒ Object private
- .write_message(socket, message) ⇒ Object private
Class Method Details
.dispatch_messages(socket) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/gauge_runtime.rb', line 35 def self.(socket) while (!socket.eof?) len = Connector.(socket) data = socket.read len = Messages::Message.parse(data) (socket, ) if . == Messages::Message::MessageType::KillProcessRequest || . == Messages::Message::MessageType::ExecutionEnding socket.close return end end end |
.handle_message(socket, message) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/gauge_runtime.rb', line 49 def self.(socket, ) if !MessageProcessor.() Gauge::Log.error "Invalid message received : #{}" execution_status_response = Messages::ExecutionStatusResponse.new(:executionResult => Messages::ProtoExecutionResult.new(:failed => true, :executionTime => 0)) = Messages::Message.new(:messageType => Messages::Message::MessageType::ExecutionStatusResponse, :messageId => ., :executionStatusResponse => execution_status_response) (socket, ) else response = MessageProcessor. (socket, response) if response end end |
.port_from_env_variable(env_variable) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
68 69 70 71 72 73 74 |
# File 'lib/gauge_runtime.rb', line 68 def self.port_from_env_variable(env_variable) port = ENV[env_variable] if port.nil? raise RuntimeError, "Could not find Env variable :#{env_variable}" end return port end |
.write_message(socket, message) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
61 62 63 64 65 66 |
# File 'lib/gauge_runtime.rb', line 61 def self.(socket, ) = .to_s size = .bytesize ProtocolBuffers::Varint.encode(socket, size) socket.write end |