Seastar
High performance C++ framework for concurrent servers
Public Member Functions | List of all members
seastar::promise< T > Class Template Reference

Detailed Description

template<typename... T>
class seastar::promise< T >

promise - allows a future value to be made available at a later time.

#include <seastar/core/future.hh>

Public Member Functions

 promise () noexcept
 Constructs an empty promise. More...
 
 promise (promise &&x) noexcept
 Moves a promise object.
 
 promise (const promise &)=delete
 
promiseoperator= (promise &&x) noexcept
 
void operator= (const promise &)=delete
 
future< T... > get_future () noexcept
 Gets the promise's associated future. More...
 
void set_value (const std::tuple< T... > &result) noexcept(copy_noexcept)
 Sets the promise's value (as tuple; by copying) More...
 
void set_value (std::tuple< T... > &&result) noexcept
 Sets the promises value (as tuple; by moving) More...
 
template<typename... A>
void set_value (A &&... a) noexcept
 Sets the promises value (variadic) More...
 
void set_exception (std::exception_ptr ex) noexcept
 Marks the promise as failed. More...
 
template<typename Exception >
void set_exception (Exception &&e) noexcept
 Marks the promise as failed. More...
 

Constructor & Destructor Documentation

◆ promise()

template<typename... T>
seastar::promise< T >::promise ( )
inlinenoexcept

Constructs an empty promise.

Creates promise with no associated future yet (see get_future()).

Member Function Documentation

◆ set_exception() [1/2]

template<typename... T>
void seastar::promise< T >::set_exception ( std::exception_ptr  ex)
inlinenoexcept

Marks the promise as failed.

Forwards the exception argument to the future and makes it available. May be called either before or after get_future().

◆ set_exception() [2/2]

template<typename... T>
template<typename Exception >
void seastar::promise< T >::set_exception ( Exception &&  e)
inlinenoexcept

Marks the promise as failed.

Forwards the exception argument to the future and makes it available. May be called either before or after get_future().

◆ set_value() [1/3]

template<typename... T>
void seastar::promise< T >::set_value ( const std::tuple< T... > &  result)
inlinenoexcept

Sets the promise's value (as tuple; by copying)

Copies the tuple argument and makes it available to the associated future. May be called either before or after get_future().

◆ set_value() [2/3]

template<typename... T>
void seastar::promise< T >::set_value ( std::tuple< T... > &&  result)
inlinenoexcept

Sets the promises value (as tuple; by moving)

Moves the tuple argument and makes it available to the associated future. May be called either before or after get_future().

◆ set_value() [3/3]

template<typename... T>
template<typename... A>
void seastar::promise< T >::set_value ( A &&...  a)
inlinenoexcept

Sets the promises value (variadic)

Forwards the arguments and makes them available to the associated future. May be called either before or after get_future().


The documentation for this class was generated from the following file: