Module: Concurrent::Promises::AbstractEventFuture::ThrottleIntegration
- Included in:
- Concurrent::Promises::AbstractEventFuture
- Defined in:
- lib-edge/concurrent/edge/throttle.rb
Instance Method Summary collapse
-
#chain_throttled_by(throttle, *args, &block) ⇒ Future, Event
Behaves as #chain but the it is throttled.
- #throttled_by(throttle) {|a| ... } ⇒ Future, Event
Instance Method Details
#chain_throttled_by(throttle, *args, &block) ⇒ Future, Event
Behaves as Concurrent::Promises::AbstractEventFuture#chain but the it is throttled.
169 170 171 |
# File 'lib-edge/concurrent/edge/throttle.rb', line 169 def chain_throttled_by(throttle, *args, &block) throttled_by(throttle) { |trigger| trigger.chain(*args, &block) } end |
#throttled_by(throttle) {|a| ... } ⇒ Future, Event
161 162 163 164 |
# File 'lib-edge/concurrent/edge/throttle.rb', line 161 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 |