Class: Utils::Probe::ProbeClient
- Includes:
- ServerHandling
- Defined in:
- lib/utils/probe/probe_client.rb
Overview
A client for interacting with the probe server through Unix domain sockets.
This class provides an interface for enqueueing process jobs and managing environment variables on a remote probe server. It uses Unix domain sockets to communicate with the server, enabling distributed task execution and configuration management.
Defined Under Namespace
Classes: EnvProxy
Instance Method Summary collapse
-
#enqueue(args) ⇒ Object
The enqueue method submits a new process job to the probe server for execution.
-
#env ⇒ Utils::ProbeServer::EnvProxy
The env method provides access to environment variable management through a proxy object.
-
#initialize(server_url:) ⇒ Utils::ProbeServer
constructor
The initialize method sets up a new probe server instance.
Methods included from ServerHandling
Constructor Details
#initialize(server_url:) ⇒ Utils::ProbeServer
The initialize method sets up a new probe server instance.
This method creates and configures the core components of the probe server, including initializing the Unix domain socket server for communication, setting up the job queue for processing tasks, and preparing the history tracking for completed jobs.
70 71 72 |
# File 'lib/utils/probe/probe_client.rb', line 70 def initialize(server_url:) @server = create_server(server_url) end |
Instance Method Details
#enqueue(args) ⇒ Object
The enqueue method submits a new process job to the probe server for execution.
This method transmits a process job request to the underlying Unix domain socket server, which then adds the job to the processing queue. The job includes the specified command arguments that will be executed by the probe server.
job
97 98 99 |
# File 'lib/utils/probe/probe_client.rb', line 97 def enqueue(args) @server.transmit({ type: 'process_job', args: }) end |
#env ⇒ Utils::ProbeServer::EnvProxy
The env method provides access to environment variable management through a proxy object.
This method returns an EnvProxy instance that allows for setting and retrieving environment variables via the probe server communication channel.
variable operations
83 84 85 |
# File 'lib/utils/probe/probe_client.rb', line 83 def env EnvProxy.new(@server) end |