Class: Concurrent::SingleThreadExecutor

Inherits:
RubySingleThreadExecutor show all
Defined in:
lib/concurrent/executor/single_thread_executor.rb,
lib/concurrent/executor/single_thread_executor.rb

Overview

Note:

When running on the JVM (JRuby) this class will inherit from ‘JavaSingleThreadExecutor`. On all other platforms it will inherit from `RubySingleThreadExecutor`.

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 ‘SingleThreadExecutor`

Method Summary

Methods inherited from RubySingleThreadExecutor

#initialize

Methods included from RubyExecutor

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

Methods included from Logging

#log

Methods included from Executor

#can_overflow?

Constructor Details

This class inherits a constructor from Concurrent::RubySingleThreadExecutor