Class: Concurrent::WrappingExecutor
| Relationships & Source Files | |
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
|
|
|
Instance Chain:
|
|
| Inherits: |
Concurrent::Synchronization::Object
|
| 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.
Constant Summary
Concern::Logging - Included
Class Attribute Summary
Synchronization::Object - Inherited
Class Method Summary
Synchronization::Object - Inherited
| .atomic_attribute?, .atomic_attributes, | |
| .attr_atomic | Creates methods for reading and writing to a instance variable with volatile (Java) semantic as |
| .attr_volatile | Creates methods for reading and writing (as |
| .ensure_safe_initialization_when_final_fields_are_present | For testing purposes, quite slow. |
| .new | Has to be called by children. |
| .safe_initialization!, .define_initialize_atomic_fields | |
Synchronization::AbstractObject - Inherited
Instance Attribute Summary
-
#can_overflow? ⇒ Boolean
readonly
Does the task queue have a maximum size?
-
#serialized? ⇒ Boolean
readonly
Does this executor guarantee serialization of its operations?
ExecutorService - Included
| #can_overflow? | Does the task queue have a maximum size? |
| #serialized? | Does this executor guarantee serialization of its operations? |
Instance Method Summary
-
#post(*args) { ... } ⇒ Boolean
Submit a task to the executor for asynchronous processing.
ExecutorService - Included
| #<< | Submit a task to the executor for asynchronous processing. |
| #post | Submit a task to the executor for asynchronous processing. |
Concern::Logging - Included
| #log | Logs through global_logger, it can be overridden by setting @logger. |
Synchronization::Object - Inherited
Synchronization::Volatile - Included
Synchronization::AbstractObject - Inherited
Constructor Details
.new(executor) {|*args, &task| ... } ⇒ WrappingExecutor
# File 'lib/concurrent-ruby-edge/concurrent/executor/wrapping_executor.rb', line 26
def initialize(executor, &wrapper) super() @Wrapper = wrapper @Executor = executor end
Instance Attribute Details
#can_overflow? ⇒ Boolean (readonly)
Does the task queue have a maximum size?
# File 'lib/concurrent-ruby-edge/concurrent/executor/wrapping_executor.rb', line 41
def can_overflow? @Executor.can_overflow? end
#serialized? ⇒ Boolean (readonly)
Does this executor guarantee serialization of its operations?
# File 'lib/concurrent-ruby-edge/concurrent/executor/wrapping_executor.rb', line 46
def serialized? @Executor.serialized? end
Instance Method Details
#post(*args) { ... } ⇒ Boolean
Submit a task to the executor for asynchronous processing.
# 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