Class: Concurrent::WrappingExecutor
- Inherits:
-
Synchronization::Object
- Object
- Synchronization::Object
- Concurrent::WrappingExecutor
- Includes:
- ExecutorService
- Defined in:
- lib/concurrent-ruby-edge/concurrent/executor/wrapping_executor.rb
Overview
A delegating executor which modifies each task with arguments before the task is given to the target executor it delegates to.
Instance Method Summary collapse
- #can_overflow? ⇒ Boolean
-
#initialize(executor) {|*args, &task| ... } ⇒ WrappingExecutor
constructor
A new instance of WrappingExecutor.
- #post(*args, &task) ⇒ Object
- #serialized? ⇒ Boolean
Constructor Details
#initialize(executor) {|*args, &task| ... } ⇒ WrappingExecutor
Returns a new instance of WrappingExecutor.
26 27 28 29 30 |
# File 'lib/concurrent-ruby-edge/concurrent/executor/wrapping_executor.rb', line 26 def initialize(executor, &wrapper) super() @Wrapper = wrapper @Executor = executor end |
Instance Method Details
#can_overflow? ⇒ Boolean
41 42 43 |
# File 'lib/concurrent-ruby-edge/concurrent/executor/wrapping_executor.rb', line 41 def can_overflow? @Executor.can_overflow? end |
#post(*args, &task) ⇒ Object
35 36 37 38 |
# File 'lib/concurrent-ruby-edge/concurrent/executor/wrapping_executor.rb', line 35 def post(*args, &task) *args, task = @Wrapper.call(*args, &task) @Executor.post(*args, &task) end |
#serialized? ⇒ Boolean
46 47 48 |
# File 'lib/concurrent-ruby-edge/concurrent/executor/wrapping_executor.rb', line 46 def serialized? @Executor.serialized? end |