dxFeed Graal CXX API v4.0.0
Loading...
Searching...
No Matches
VoidPromiseMixin< P > Struct Template Reference

Mixin for wrapping Promise method calls for a void. More...

#include <Promise.hpp>

Public Member Functions

void getResult () const
 Returns result of computation.
 
void await () const
 Wait for computation to complete and return its result or throw an exception in case of exceptional completion.
 
void await (std::int32_t timeoutInMilliseconds) const &
 Wait for computation to complete or timeout and return its result or throw an exception in case of exceptional completion or timeout.
 
void await (const std::chrono::milliseconds &timeoutInMilliseconds) const &
 Wait for computation to complete or timeout and return its result or throw an exception in case of exceptional completion or timeout.
 

Detailed Description

template<typename P>
struct VoidPromiseMixin< P >

Mixin for wrapping Promise method calls for a void.

Template Parameters
PThe promise type.

Member Function Documentation

◆ await() [1/3]

template<typename P >
void VoidPromiseMixin< P >::await ( ) const
inline

Wait for computation to complete and return its result or throw an exception in case of exceptional completion.

Returns
result of computation.
Exceptions
CancellationExceptionif computation was cancelled.
PromiseExceptionif computation has completed exceptionally.

◆ await() [2/3]

template<typename P >
void VoidPromiseMixin< P >::await ( const std::chrono::milliseconds & timeoutInMilliseconds) const &
inline

Wait for computation to complete or timeout and return its result or throw an exception in case of exceptional completion or timeout.

Parameters
timeoutInMillisecondsThe timeout.
Returns
The result of computation.
Exceptions
CancellationExceptionif computation was cancelled or timed out.
PromiseExceptionif computation has completed exceptionally.

◆ await() [3/3]

template<typename P >
void VoidPromiseMixin< P >::await ( std::int32_t timeoutInMilliseconds) const &
inline

Wait for computation to complete or timeout and return its result or throw an exception in case of exceptional completion or timeout.

Parameters
timeoutInMillisecondsThe timeout.
Returns
The result of computation.
Exceptions
CancellationExceptionif computation was cancelled or timed out.
PromiseExceptionif computation has completed exceptionally.

◆ getResult()

template<typename P >
void VoidPromiseMixin< P >::getResult ( ) const
inline

Returns result of computation.

Returns
The result of computation.
See also
CommonPromiseMixin::hasResult()