Class: Concurrent::Throttle::ProxyExecutor
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
|
|
Instance Chain:
|
|
Inherits: |
Concurrent::Synchronization::Object
|
Defined in: | lib/concurrent-ruby-edge/concurrent/edge/throttle.rb |
Constant Summary
Concern::Logging
- Included
Class Attribute Summary
Synchronization::Object
- Inherited
Class Method Summary
- .new(throttle, executor) ⇒ ProxyExecutor constructor
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
- #serialized? ⇒ Boolean readonly
ExecutorService
- Included
#can_overflow? | Does the task queue have a maximum size? |
#serialized? | Does this executor guarantee serialization of its operations? |
Instance Method Summary
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 Concurrent.global_logger, it can be overridden by setting @logger. |
Synchronization::Object
- Inherited
Synchronization::Volatile
- Included
Synchronization::AbstractObject
- Inherited
Constructor Details
.new(throttle, executor) ⇒ ProxyExecutor
# File 'lib/concurrent-ruby-edge/concurrent/edge/throttle.rb', line 192
def initialize(throttle, executor) super() @Throttle = throttle @Executor = executor end
Instance Attribute Details
#can_overflow? ⇒ Boolean
(readonly)
# File 'lib/concurrent-ruby-edge/concurrent/edge/throttle.rb', line 206
def can_overflow? @Executor.can_overflow? end
#serialized? ⇒ Boolean
(readonly)
# File 'lib/concurrent-ruby-edge/concurrent/edge/throttle.rb', line 210
def serialized? @Executor.serialized? end
Instance Method Details
#inner_post(*arguments, &task) (private)
[ GitHub ]#post(*args, &task)
[ GitHub ]# File 'lib/concurrent-ruby-edge/concurrent/edge/throttle.rb', line 198
def post(*args, &task) if (event = @Throttle.acquire_or_event) event.on_resolution! { inner_post(*args, &task) } else inner_post(*args, &task) end end