instance method build_async_executor

Ruby on Rails 8.1.2

Since v7.0.10 Private

Available in: v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

build_async_executor()

No documentation comment.

Source
# File activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb, line 906
        def build_async_executor
          case ActiveRecord.async_query_executor
          when :multi_thread_pool
            if @db_config.max_threads > 0
              name_with_shard = [name_inspect, shard_inspect].join("-").tr("_", "-")
              Concurrent::ThreadPoolExecutor.new(
                name: "ActiveRecord-#{name_with_shard}-async-query-executor",
                min_threads: @db_config.min_threads,
                max_threads: @db_config.max_threads,
                max_queue: @db_config.max_queue,
                fallback_policy: :caller_runs
              )
            end
          when :global_thread_pool
            ActiveRecord.global_thread_pool_async_query_executor
          end
        end

Defined in activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb line 906 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveRecord::ConnectionAdapters::ConnectionPool

Type at least 2 characters to search.

↑↓ navigate · open · esc close