Module: Concurrent::Throttle::PromisesIntegration
- Included in:
- Concurrent::Throttle
- Defined in:
- lib/concurrent/edge/throttle.rb
Instance Method Summary (collapse)
-
- (Promises::Future) throttled_future(*args, &task)
Behaves as Promises::FactoryMethods#future but the future is throttled.
-
- (Promises::Event, Promises::Future) throttled_future_chain {|trigger| ... }
Allows to throttle a chain of promises.
Instance Method Details
- (Promises::Future) throttled_future(*args, &task)
Behaves as Promises::FactoryMethods#future but the future is throttled.
142 143 144 |
# File 'lib/concurrent/edge/throttle.rb', line 142 def throttled_future(*args, &task) trigger.chain(*args, &task).on_resolution! { release } end |
- (Promises::Event, Promises::Future) throttled_future_chain {|trigger| ... }
Allows to throttle a chain of promises.
134 135 136 |
# File 'lib/concurrent/edge/throttle.rb', line 134 def throttled_future_chain(&throttled_futures) throttled_futures.call(trigger).on_resolution! { release } end |