Async::Job::Adapter::AsyncJobSourceAsyncJobAdapterActiveJobEnvironment

module Environment

The environment for the ActiveJob server.

Definitions

def service_class

The service class to use.

Implementation

def service_class
	Service
end

def root

The rails root.

Implementation

def root
	ENV.fetch("RAILS_ROOT", Dir.pwd)
end

def dispatcher

Get the default dispatcher instance.

Signature

returns Object

The dispatcher from the Railtie.

Implementation

def dispatcher
	Railtie.dispatcher
end

def queue_names

The name of the queue to use.

Implementation

def queue_names
	if queue_names = ENV["ASYNC_JOB_ADAPTER_ACTIVE_JOB_QUEUE_NAMES"]
		queue_names.split(",")
	else
		dispatcher.keys
	end
end

def count

Number of instances to start. By default (when nil), uses Etc.nprocessors.

Signature

returns Integer | nil

Implementation

def count
	nil
end

def container_options

Options to use when creating the container.

Implementation

def container_options
	{
		restart: true,
		count: self.count,
		health_check_timeout: 30,
	}.compact
end