Sha256: b39123ae077dbf92d9eafb96136287f969f50bf237eea0fa1fdc69e3ac2de55a

Contents?: true

Size: 1.87 KB

Versions: 23

Compression:

Stored size: 1.87 KB

Contents

require 'concurrent/executor/ruby_single_thread_executor'

module Concurrent

  if Concurrent.on_jruby?
    require 'concurrent/executor/java_single_thread_executor'
  end

  SingleThreadExecutorImplementation = case
                                       when Concurrent.on_jruby?
                                         JavaSingleThreadExecutor
                                       else
                                         RubySingleThreadExecutor
                                       end
  private_constant :SingleThreadExecutorImplementation

  # @!macro [attach] single_thread_executor
  #
  #   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`
  #
  # @!macro thread_pool_options
  # @!macro abstract_executor_service_public_api
  class SingleThreadExecutor < SingleThreadExecutorImplementation

    # @!macro [new] single_thread_executor_method_initialize
    #
    #   Create a new thread pool.
    #
    #   @option opts [Symbol] :fallback_policy (:discard) the policy for
    #     handling new tasks that are received when the queue size has
    #     reached `max_queue` or after the executor has shut down
    #
    #   @see http://docs.oracle.com/javase/tutorial/essential/concurrency/pools.html
    #   @see http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Executors.html
    #   @see http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ExecutorService.html

    # @!method initialize(opts = {})
    #   @!macro single_thread_executor_method_initialize
  end
end

Version data entries

23 entries across 21 versions & 5 rubygems

Version Path
logstash-filter-zabbix-0.1.2 vendor/bundle/jruby/1.9/gems/concurrent-ruby-0.9.2-java/lib/concurrent/executor/single_thread_executor.rb
logstash-filter-zabbix-0.1.1 vendor/bundle/jruby/1.9/gems/concurrent-ruby-0.9.2-java/lib/concurrent/executor/single_thread_executor.rb
ivanvc-logstash-input-s3-3.1.1.4 vendor/local/gems/concurrent-ruby-0.9.2-java/lib/concurrent/executor/single_thread_executor.rb
ivanvc-logstash-input-s3-3.1.1.3 vendor/local/gems/concurrent-ruby-0.9.2-java/lib/concurrent/executor/single_thread_executor.rb
ivanvc-logstash-input-s3-3.1.1.2 vendor/local/gems/concurrent-ruby-0.9.2-java/lib/concurrent/executor/single_thread_executor.rb
logstash-input-beats-2.0.2 vendor/jruby/1.9/gems/concurrent-ruby-0.9.2-java/lib/concurrent/executor/single_thread_executor.rb
logstash-input-beats-2.0.2 vendor/jruby/1.9/gems/logstash-codec-json-2.0.3/vendor/gems/concurrent-ruby-0.9.1-java/lib/concurrent/executor/single_thread_executor.rb
logstash-input-beats-2.0.2 vendor/jruby/1.9/gems/concurrent-ruby-0.9.1-java/lib/concurrent/executor/single_thread_executor.rb
logstash-codec-json-2.0.3 vendor/gems/concurrent-ruby-0.9.1-java/lib/concurrent/executor/single_thread_executor.rb
concurrent-ruby-0.9.2-java lib/concurrent/executor/single_thread_executor.rb
concurrent-ruby-0.9.2 lib/concurrent/executor/single_thread_executor.rb
logstash-input-beats-0.9.2 vendor/jruby/1.9/gems/concurrent-ruby-0.9.1-java/lib/concurrent/executor/single_thread_executor.rb
logstash-input-beats-0.9.1 vendor/jruby/1.9/gems/concurrent-ruby-0.9.1-java/lib/concurrent/executor/single_thread_executor.rb
concurrent-ruby-1.0.0.pre1 lib/concurrent/executor/single_thread_executor.rb
concurrent-ruby-1.0.0.pre1-java lib/concurrent/executor/single_thread_executor.rb
concurrent-ruby-0.9.1 lib/concurrent/executor/single_thread_executor.rb
concurrent-ruby-0.9.1-java lib/concurrent/executor/single_thread_executor.rb
concurrent-ruby-0.9.0 lib/concurrent/executor/single_thread_executor.rb
concurrent-ruby-0.9.0-java lib/concurrent/executor/single_thread_executor.rb
concurrent-ruby-0.9.0.pre3-java lib/concurrent/executor/single_thread_executor.rb