Async::Container::SupervisorSourceAsyncContainerSupervisorSupervised

module Supervised

An environment mixin for supervised worker services.

Enables workers to connect to and be supervised by the supervisor.

Definitions

def supervisor_ipc_path

The IPC path to use for communication with the supervisor.

Signature

returns String

Implementation

def supervisor_ipc_path
	::File.expand_path("supervisor.ipc", root)
end

def supervisor_endpoint

The endpoint the supervisor will bind to.

Signature

returns ::IO::Endpoint::Generic

Implementation

def supervisor_endpoint
	::IO::Endpoint.unix(supervisor_ipc_path)
end

def make_supervised_worker(instance)

Create a supervised worker for the given instance.

Signature

parameter instance Async::Container::Instance

The container instance.

returns Worker

The worker client.

Implementation

def make_supervised_worker(instance)
	Worker.new(instance, endpoint: supervisor_endpoint)
end