class AsyncAdapter
Ruby on Rails 7.0.10
Since v5.2.8.1Active Job Async adapter
The Async adapter runs jobs with an in-process thread pool.
This is the default queue adapter. It’s well-suited for dev/test since it doesn’t need an external infrastructure, but it’s a poor fit for production since it drops pending jobs on restart.
To use this adapter, set queue adapter to :async:
config.active_job.queue_adapter = :async
To configure the adapter’s thread pool, instantiate the adapter and pass your own config:
config.active_job.queue_adapter = ActiveJob::QueueAdapters::AsyncAdapter.new \ min_threads: 1, max_threads: 2 * Concurrent.processor_count, idletime: 600.seconds
The adapter uses a Concurrent Ruby thread pool to schedule and execute jobs. Since jobs share a single thread pool, long-running jobs will block short-lived jobs. Fine for dev/test; bad for production.
Inherits from
Methods (defined here)
- self. new
Methods (inherited)
From Object (16)
- # acts_like?
- # blank?
- # deep_dup
- # duplicable?
- # html_safe?
- # in?
- # instance_values
- # instance_variable_names
- # presence
- # presence_in
- # present?
- # to_param
- # to_query
- # try
- # try!
- # with_options
From ActiveRecord::TestFixtures (4)
From ActiveSupport::Concern (3)
- # class_methods
- # included
- # prepended