Module: Concurrent::Throttle::PromisesIntegration
- Included in:
- Concurrent::Throttle
- Defined in:
- lib-edge/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.
145 146 147 |
# File 'lib-edge/concurrent/edge/throttle.rb', line 145 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.
137 138 139 |
# File 'lib-edge/concurrent/edge/throttle.rb', line 137 def throttled_future_chain(&throttled_futures) throttled_futures.call(trigger).on_resolution! { release } end |