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