Clio develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
util::async::AnyStrand Class Reference

A type-erased execution context. More...

#include <AnyStrand.hpp>

Public Member Functions

template<NotSameAs< AnyStrand > StrandType>
 AnyStrand (StrandType &&strand)
 Construct a new Any Strand object.
 
 AnyStrand (AnyStrand const &)=default
 
 AnyStrand (AnyStrand &&)=default
 
auto execute (SomeHandlerWithoutStopToken auto &&fn)
 Execute a function without a stop token on the strand.
 
auto execute (SomeHandlerWith< AnyStopToken > auto &&fn)
 Execute a function taking a stop token on the strand.
 
auto execute (SomeHandlerWith< AnyStopToken > auto &&fn, SomeStdDuration auto timeout)
 Execute a function taking a stop token on the strand with a timeout.
 

Detailed Description

A type-erased execution context.

Constructor & Destructor Documentation

◆ AnyStrand()

template<NotSameAs< AnyStrand > StrandType>
util::async::AnyStrand::AnyStrand ( StrandType && strand)
inline

Construct a new Any Strand object.

Template Parameters
StrandTypeThe type of the strand to wrap
Parameters
strandThe strand to wrap

Member Function Documentation

◆ execute() [1/3]

auto util::async::AnyStrand::execute ( SomeHandlerWith< AnyStopToken > auto && fn)
inlinenodiscard

Execute a function taking a stop token on the strand.

Parameters
fnThe function to execute
Returns
The type-erased operation

◆ execute() [2/3]

auto util::async::AnyStrand::execute ( SomeHandlerWith< AnyStopToken > auto && fn,
SomeStdDuration auto timeout )
inlinenodiscard

Execute a function taking a stop token on the strand with a timeout.

Parameters
fnThe function to execute
timeoutThe timeout for the function
Returns
The type-erased operation

◆ execute() [3/3]

auto util::async::AnyStrand::execute ( SomeHandlerWithoutStopToken auto && fn)
inlinenodiscard

Execute a function without a stop token on the strand.

Parameters
fnThe function to execute
Returns
The type-erased operation

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