Class List Method List File List

# Class: Concurrent::JavaThreadPoolExecutor

Inherits:
  JavaExecutorService
  - Object
  - Synchronization::LockableObject
  - AbstractExecutorService
  - JavaExecutorService
  - Concurrent::JavaThreadPoolExecutor
  show all
Defined in:
  lib/concurrent/executor/java_thread_pool_executor.rb

## Constant Summary

DEFAULT_MAX_POOL_SIZE =

      java.lang.Integer::MAX_VALUE

DEFAULT_MIN_POOL_SIZE =

      0

DEFAULT_MAX_QUEUE_SIZE =

      0

DEFAULT_THREAD_IDLETIMEOUT =

      60

## Instance Attribute Summary (collapse)

- - (Symbol) fallback_policy inherited from JavaExecutorService readonly

  The fallback policy in effect.

- - (Symbol) fallback_policy inherited from AbstractExecutorService readonly

  The fallback policy in effect.

- - (undocumented) max_length readonly

  Returns the value of attribute max_length.

- - (undocumented) max_queue readonly

  Returns the value of attribute max_queue.

## Instance Method Summary (collapse)

- - (Boolean) can_overflow?
- - (undocumented) completed_task_count
- - (undocumented) idletime
- - (JavaThreadPoolExecutor) initialize(opts = {}) constructor

  A new instance of JavaThreadPoolExecutor.

- - (undocumented) largest_length
- - (undocumented) length
- - (undocumented) min_length
- - (undocumented) queue_length
- - (undocumented) remaining_capacity
- - (Boolean) running?
- - (undocumented) scheduled_task_count

## Constructor Details

### - (`JavaThreadPoolExecutor`) initialize(opts = {})

Returns a new instance of JavaThreadPoolExecutor

    31
    32
    33

    # File 'lib/concurrent/executor/java_thread_pool_executor.rb', line 31

    def initialize(opts = {})
      super(opts)
    end

## Instance Attribute Details

### - (`Symbol`) fallback_policy (readonly) Originally defined in class JavaExecutorService

Returns The fallback policy in effect. Either `:abort`, `:discard`, or `:caller_runs`.

Returns:

- (`Symbol`) —

  The fallback policy in effect. Either `:abort`, `:discard`, or `:caller_runs`.

### - (`Symbol`) fallback_policy (readonly) Originally defined in class AbstractExecutorService

Returns The fallback policy in effect. Either `:abort`, `:discard`, or `:caller_runs`.

Returns:

- (`Symbol`) —

  The fallback policy in effect. Either `:abort`, `:discard`, or `:caller_runs`.

### - (`undocumented`) max_length (readonly)

Returns the value of attribute max_length

    25
    26
    27

    # File 'lib/concurrent/executor/java_thread_pool_executor.rb', line 25

    def max_length
      @max_length
    end

### - (`undocumented`) max_queue (readonly)

Returns the value of attribute max_queue

    28
    29
    30

    # File 'lib/concurrent/executor/java_thread_pool_executor.rb', line 28

    def max_queue
      @max_queue
    end

## Instance Method Details

### - (`Boolean`) can_overflow?

Returns:

- (`Boolean`)

    36
    37
    38

    # File 'lib/concurrent/executor/java_thread_pool_executor.rb', line 36

    def can_overflow?
      @max_queue != 0
    end

### - (`undocumented`) completed_task_count

    66
    67
    68

    # File 'lib/concurrent/executor/java_thread_pool_executor.rb', line 66

    def completed_task_count
      @executor.getCompletedTaskCount
    end

### - (`undocumented`) idletime

    71
    72
    73

    # File 'lib/concurrent/executor/java_thread_pool_executor.rb', line 71

    def idletime
      @executor.getKeepAliveTime(java.util.concurrent.TimeUnit::SECONDS)
    end

### - (`undocumented`) largest_length

    56
    57
    58

    # File 'lib/concurrent/executor/java_thread_pool_executor.rb', line 56

    def largest_length
      @executor.getLargestPoolSize
    end

### - (`undocumented`) length

    51
    52
    53

    # File 'lib/concurrent/executor/java_thread_pool_executor.rb', line 51

    def length
      @executor.getPoolSize
    end

### - (`undocumented`) min_length

    41
    42
    43

    # File 'lib/concurrent/executor/java_thread_pool_executor.rb', line 41

    def min_length
      @executor.getCorePoolSize
    end

### - (`undocumented`) queue_length

    76
    77
    78

    # File 'lib/concurrent/executor/java_thread_pool_executor.rb', line 76

    def queue_length
      @executor.getQueue.size
    end

### - (`undocumented`) remaining_capacity

    81
    82
    83

    # File 'lib/concurrent/executor/java_thread_pool_executor.rb', line 81

    def remaining_capacity
      @max_queue == 0 ? -1 : @executor.getQueue.remainingCapacity
    end

### - (`Boolean`) running?

Returns:

- (`Boolean`)

    86
    87
    88

    # File 'lib/concurrent/executor/java_thread_pool_executor.rb', line 86

    def running?
      super && !@executor.isTerminating
    end

### - (`undocumented`) scheduled_task_count

    61
    62
    63

    # File 'lib/concurrent/executor/java_thread_pool_executor.rb', line 61

    def scheduled_task_count
      @executor.getTaskCount
    end