Class: Concurrent::SerializedExecutionDelegator
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
SimpleDelegator
|
|
Instance Chain:
|
|
Inherits: |
SimpleDelegator
|
Defined in: | lib/concurrent-ruby/concurrent/executor/serialized_execution_delegator.rb |
Overview
A wrapper/delegator for any ExecutorService
that guarantees serialized execution of tasks.
Constant Summary
Concern::Logging
- Included
Class Method Summary
- .new(executor) ⇒ SerializedExecutionDelegator constructor
Instance Attribute Summary
SerialExecutorService
- Included
#serialized? | 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. |
Constructor Details
.new(executor) ⇒ SerializedExecutionDelegator
# File 'lib/concurrent-ruby/concurrent/executor/serialized_execution_delegator.rb', line 15
def initialize(executor) @executor = executor @serializer = SerializedExecution.new super(executor) end
Instance Method Details
#post(*args) { ... } ⇒ Boolean
Submit a task to the executor for asynchronous processing.
# File 'lib/concurrent-ruby/concurrent/executor/serialized_execution_delegator.rb', line 22
def post(*args, &task) raise ArgumentError.new('no block given') unless block_given? return false unless running? @serializer.post(@executor, *args, &task) end