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

Detailed Description

template<>
class seastar::promise< void >

Specialization of promise<void>

This is an alias for promise<>, for generic programming purposes. For example, You may have a promise<T> where T can legally be void.

#include <seastar/core/future.hh>

Inheritance diagram for seastar::promise< void >:
seastar::promise<>

Public Member Functions

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...
 
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...
 
void set_exception (Exception &&e) noexcept
 Marks the promise as failed. More...
 

Member Function Documentation

◆ get_future()

future< T... > seastar::promise< T >::get_future ( )
inlinenoexceptinherited

Gets the promise's associated future.

The future and promise will be remember each other, even if either or both are moved. When set_value() or set_exception() are called on the promise, the future will be become ready, and if a continuation was attached to the future, it will run.

◆ set_exception() [1/2]

void seastar::promise< T >::set_exception ( std::exception_ptr  ex)
inlinenoexceptinherited

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]

void seastar::promise< T >::set_exception ( Exception &&  e)
inlinenoexceptinherited

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]

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

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]

void seastar::promise< T >::set_value ( std::tuple< T... > &&  result)
inlinenoexceptinherited

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]

void seastar::promise< T >::set_value ( A &&...  a)
inlinenoexceptinherited

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: