Class: Concurrent::WrappingExecutor
- Inherits:
-
Synchronization::Object
- Object
- Synchronization::Object
- Concurrent::WrappingExecutor
- 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
Does the task queue have a maximum size?.
-
#initialize(executor) {|*args, &task| ... } ⇒ WrappingExecutor
constructor
A new instance of WrappingExecutor.
-
#post(*args) { ... } ⇒ Boolean
Submit a task to the executor for asynchronous processing.
-
#serialized? ⇒ Boolean
Does this executor guarantee serialization of its operations?.
Constructor Details
#initialize(executor) {|*args, &task| ... } ⇒ WrappingExecutor
Returns a new instance of WrappingExecutor.
23 24 25 26 27 |
# File 'lib/concurrent-ruby-edge/concurrent/executor/wrapping_executor.rb', line 23 def initialize(executor, &wrapper) super() @Wrapper = wrapper @Executor = executor end |
Instance Method Details
#can_overflow? ⇒ Boolean
Does the task queue have a maximum size?
38 39 40 |
# File 'lib/concurrent-ruby-edge/concurrent/executor/wrapping_executor.rb', line 38 def can_overflow? @Executor.can_overflow? end |
#post(*args) { ... } ⇒ Boolean
Submit a task to the executor for asynchronous processing.
32 33 34 35 |
# File 'lib/concurrent-ruby-edge/concurrent/executor/wrapping_executor.rb', line 32 def post(*args, &task) *args, task = @Wrapper.call(*args, &task) @Executor.post(*args, &task) end |
#serialized? ⇒ Boolean
Does this executor guarantee serialization of its operations?
43 44 45 |
# File 'lib/concurrent-ruby-edge/concurrent/executor/wrapping_executor.rb', line 43 def serialized? @Executor.serialized? end |