Module: Concurrent::Promises::FactoryMethods
- Included in:
- Throttle
- Defined in:
- lib/concurrent-ruby-edge/concurrent/edge/promises.rb,
lib/concurrent-ruby-edge/concurrent/edge/old_channel_integration.rb
Instance Method Summary collapse
- #zip_futures_over(enumerable, &future_factory) ⇒ Future
-
#zip_futures_over_on(default_executor, enumerable) {|element| ... } ⇒ Future
Creates new future which is resolved after all the futures created by future_factory from enumerable elements are resolved.
Instance Method Details
#zip_futures_over(enumerable, &future_factory) ⇒ Future
72 73 74 |
# File 'lib/concurrent-ruby-edge/concurrent/edge/promises.rb', line 72 def zip_futures_over(enumerable, &future_factory) zip_futures_over_on default_executor, enumerable, &future_factory end |
#zip_futures_over_on(default_executor, enumerable) {|element| ... } ⇒ Future
Creates new future which is resolved after all the futures created by future_factory from enumerable elements are resolved. Simplified it does: ‘zip(*enumerable.map { |e| future e, &future_factory })`
90 91 92 93 |
# File 'lib/concurrent-ruby-edge/concurrent/edge/promises.rb', line 90 def zip_futures_over_on(default_executor, enumerable, &future_factory) # ZipFuturesPromise.new_blocked_by(futures_and_or_events, default_executor).future zip_futures_on(default_executor, *enumerable.map { |e| future e, &future_factory }) end |