Sha256: c49e4b437488161b1dab830112eddf799a80e542ac81803d2000b650f55197f5

Contents?: true

Size: 938 Bytes

Versions: 2

Compression:

Stored size: 938 Bytes

Contents

# frozen_string_literal: true

# Released under the MIT License.
# Copyright, 2019-2024, by Samuel Williams.

require_relative '../service/supervisor'
require_relative '../environment'

module Falcon
	module Environment
		# Provides an environment for hosting a supervisor which can monitor multiple applications.
		module Supervisor
			# The name of the supervisor
			# @returns [String]
			def name
				"supervisor"
			end
			
			# The IPC path to use for communication with the supervisor.
			# @returns [String]
			def ipc_path
				::File.expand_path("supervisor.ipc", root)
			end
			
			# The endpoint the supervisor will bind to.
			# @returns [::IO::Endpoint::Generic]
			def endpoint
				::IO::Endpoint.unix(ipc_path)
			end
			
			# The service class to use for the supervisor.
			# @returns [Class]
			def service_class
				::Falcon::Service::Supervisor
			end
		end
		
		LEGACY_ENVIRONMENTS[:supervisor] = Supervisor
	end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
falcon-0.47.7 lib/falcon/environment/supervisor.rb
falcon-0.47.1 lib/falcon/environment/supervisor.rb