Method: ActiveRecord#async_query_executor
- Defined in:
- activerecord/lib/active_record.rb
#async_query_executor ⇒ Object
:singleton-method: async_query_executor Sets the async_query_executor for an application. By default the thread pool executor set to nil which will not run queries in the background. Applications must configure a thread pool executor to use this feature. Options are:
* nil - Does not initialize a thread pool executor. Any async calls will be
run in the foreground.
* :global_thread_pool - Initializes a single +Concurrent::ThreadPoolExecutor+
that uses the +async_query_concurrency+ for the +max_threads+ value.
* :multi_thread_pool - Initializes a +Concurrent::ThreadPoolExecutor+ for each
database connection. The initializer values are defined in the configuration hash.
288 289 290 |
# File 'activerecord/lib/active_record.rb', line 288 def async_query_executor @async_query_executor end |