class Worker
A worker represents a long running process that can be subjected to chaos by the chaos server.
Various chaos operations can be executed on the worker, such as delays, errors, and resource consumption.
Definitions
def self.run(process_id: Process.pid, endpoint: ChaosKitty.endpoint)
Run a worker with the given process ID.
Signature
-
parameter
process_idInteger The process ID to register with the chaos server.
-
parameter
endpointIO::Endpoint The chaos endpoint to connect to.
Implementation
def self.run(process_id: Process.pid, endpoint: ChaosKitty.endpoint)
self.new(process_id: process_id, endpoint: endpoint).run
end
def initialize(process_id: Process.pid, endpoint: ChaosKitty.endpoint)
Initialize a new worker.
Signature
-
parameter
process_idInteger The process ID to register with the chaos server.
-
parameter
endpointIO::Endpoint The chaos endpoint to connect to.
Implementation
def initialize(process_id: Process.pid, endpoint: ChaosKitty.endpoint)
super(endpoint: endpoint)
@id = nil
@process_id = process_id
end
attr :id
Signature
-
attribute
Integer The ID assigned by the chaos server.
attr :process_id
Signature
-
attribute
Integer The process ID of the worker.