Class: Concurrent::FixedThreadPool

Inherits:
RubyFixedThreadPool show all
Defined in:
lib/concurrent/executor/fixed_thread_pool.rb,
lib/concurrent/executor/fixed_thread_pool.rb

Overview

Note:

When running on the JVM (JRuby) this class will inherit from JavaFixedThreadPool. On all other platforms it will inherit from RubyFixedThreadPool.

A thread pool with a set number of threads. The number of threads in the pool is set on construction and remains constant. When all threads are busy new tasks #post to the thread pool are enqueued until a thread becomes available. Should a thread crash for any reason the thread will immediately be removed from the pool and replaced.

The API and behavior of this class are based on Java’s FixedThreadPool

Constant Summary

Constants inherited from RubyThreadPoolExecutor

RubyThreadPoolExecutor::DEFAULT_MAX_POOL_SIZE, RubyThreadPoolExecutor::DEFAULT_MAX_QUEUE_SIZE, RubyThreadPoolExecutor::DEFAULT_MIN_POOL_SIZE, RubyThreadPoolExecutor::DEFAULT_THREAD_IDLETIMEOUT

Constants included from RubyExecutor

RubyExecutor::FALLBACK_POLICIES

Instance Attribute Summary

Attributes inherited from RubyThreadPoolExecutor

#completed_task_count, #idletime, #largest_length, #max_length, #max_queue, #min_length, #scheduled_task_count

Attributes included from Executor

#fallback_policy

Method Summary

Methods inherited from RubyFixedThreadPool

#initialize

Methods inherited from RubyThreadPoolExecutor

#can_overflow?, #initialize, #length, #queue_length, #remaining_capacity, #status

Methods included from RubyExecutor

#<<, #kill, #post, #running?, #shutdown, #shutdown?, #shuttingdown?, #wait_for_termination

Methods included from Logging

#log

Methods included from Executor

#can_overflow?, #serialized?

Constructor Details

This class inherits a constructor from Concurrent::RubyFixedThreadPool