Function asCompleted

Return a generator whose values, when waited for, are Future instances in the order they complete.

Raises TimeoutException if the timeout occurs before all futures are done.

Prototype

auto GeneratorTask!(asynchronous.futures.FutureHandle) asCompleted(
  EventLoop eventLoop,
  asynchronous.futures.FutureHandle[] futures,
  core.time.Duration timeout = zero()
);

Example

foreach (f; getEventLoop.asCompleted(fs)) // use f.result

Note

The futures f are not necessarily members of fs.

Authors

Dragos Carp

Copyright

© 2015-2016 Dragos Carp

License

Boost Software License - Version 1.0