Module: Concurrent::Promises::AbstractEventFuture::ThrottleIntegration
- Included in:
- Concurrent::Promises::AbstractEventFuture
- Defined in:
- lib/concurrent/edge/throttle.rb
Instance Method Summary collapse
-
#chain_throttled_by(throttle, *args, &block) ⇒ Promises::Future, Promises::Event
Behaves as #chain but the it is throttled.
- #throttled_by(throttle, &throttled_futures) ⇒ Object
Instance Method Details
#chain_throttled_by(throttle, *args, &block) ⇒ Promises::Future, Promises::Event
Behaves as Concurrent::Promises::AbstractEventFuture#chain but the it is throttled.
162 163 164 |
# File 'lib/concurrent/edge/throttle.rb', line 162 def chain_throttled_by(throttle, *args, &block) throttled_by(throttle) { |trigger| trigger.chain(*args, &block) } end |
#throttled_by(throttle, &throttled_futures) ⇒ Object
154 155 156 157 |
# File 'lib/concurrent/edge/throttle.rb', line 154 def throttled_by(throttle, &throttled_futures) a_trigger = self & self.chain { throttle.trigger }.flat_event throttled_futures.call(a_trigger).on_resolution! { throttle.release } end |