dxFeed Graal CXX API v4.0.0
Loading...
Searching...
No Matches
Promises Struct Reference

Utility methods to manipulate promises. More...

#include <Promises.hpp>

Static Public Member Functions

template<typename Collection >
static std::shared_ptr< Promise< void > > allOf (Collection &&collection)
 Returns a new promise that completes when all promises from the given collection complete normally or exceptionally.
 

Detailed Description

Utility methods to manipulate promises.

Member Function Documentation

◆ allOf()

template<typename Collection >
static std::shared_ptr< Promise< void > > Promises::allOf ( Collection && collection)
inlinestatic

Returns a new promise that completes when all promises from the given collection complete normally or exceptionally.

The results of the given promises are not reflected in the returned promise, but may be obtained by inspecting them individually. If no promises are provided, returns a promise completed with the value void. When the resulting promise completes for any reason (is canceled, for example) then all of the promises from the given array are canceled.

Template Parameters
CollectionThe collection type. For example: PromiseList<LastingEvent> (i.e. std::vector<Promise<std::shared_ptr<LastingEvent>>>) or std::vector<std::shared_ptr<Promise<std::shared_ptr<LastingEvent>>>>.
Parameters
collectionThe collection of promises or collection of pointer-like of promises
Returns
A new promise that completes when all promises from the given array complete.