userver: engine::AwaitableToken Class Reference
Loading...
Searching...
No Matches
engine::AwaitableToken Class Referencefinal

#include <userver/engine/awaitable.hpp>

Detailed Description

A lightweight token that exposes a view over an awaitable to engine::WaitAny and friends.

User-facing awaitable types return this token from their GetAwaitableToken methods. Empty token means that the object cannot be awaited right now.

Definition at line 23 of file awaitable.hpp.

Public Member Functions

constexpr AwaitableToken () noexcept=default
 Creates an empty token. It will be skipped in engine::WaitAny and friends.
 
 AwaitableToken (const AwaitableToken &) noexcept=default
 
 AwaitableToken (AwaitableToken &&) noexcept=default
 
AwaitableTokenoperator= (const AwaitableToken &) noexcept=default
 
AwaitableTokenoperator= (AwaitableToken &&) noexcept=default
 
constexpr bool IsEmpty () const noexcept
 Returns true if the token does not refer to an awaitable.
 
constexpr bool operator== (const AwaitableToken &other) const noexcept
 Compares referred awaitables.
 

Member Function Documentation

◆ IsEmpty()

bool engine::AwaitableToken::IsEmpty ( ) const
inlinenodiscardconstexprnoexcept

Returns true if the token does not refer to an awaitable.

Definition at line 35 of file awaitable.hpp.

◆ operator==()

bool engine::AwaitableToken::operator== ( const AwaitableToken & other) const
inlinenodiscardconstexprnoexcept

Compares referred awaitables.

Definition at line 38 of file awaitable.hpp.


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