A type-erased execution context.
More...
#include <AnyStrand.hpp>
|
| 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.
|
| auto | executeRepeatedly (SomeStdDuration auto interval, SomeHandlerWithoutStopToken auto &&fn) |
| | Schedule a repeating operation on the execution context.
|
A type-erased execution context.
◆ AnyStrand()
| util::async::AnyStrand::AnyStrand |
( |
StrandType && | strand | ) |
|
|
inline |
Construct a new Any Strand object.
- Template Parameters
-
| StrandType | The type of the strand to wrap |
- Parameters
-
◆ execute() [1/3]
| auto util::async::AnyStrand::execute |
( |
SomeHandlerWith< AnyStopToken > auto && | fn | ) |
|
|
inlinenodiscard |
Execute a function taking a stop token on the strand.
- Parameters
-
| fn | The 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
-
| fn | The function to execute |
| timeout | The 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
-
| fn | The function to execute |
- Returns
- The type-erased operation
◆ executeRepeatedly()
| auto util::async::AnyStrand::executeRepeatedly |
( |
SomeStdDuration auto | interval, |
|
|
SomeHandlerWithoutStopToken auto && | fn ) |
|
inlinenodiscard |
Schedule a repeating operation on the execution context.
- Parameters
-
| interval | The interval at which the operation should be repeated |
| fn | The block of code to execute; no args allowed and return type must be void |
- Returns
- A repeating stoppable operation that can be used to wait for its cancellation
The documentation for this class was generated from the following file: