WaitableLambdaTask class
A waitable task that runs a stored callable.
On this page
- Use
import ThinkMeta.ConcurrentTasks.Tasks.WaitableTask;- Namespace
ThinkMeta::ConcurrentTasks::Tasks- Inherits
WaitableTask
Syntax
template <std::invocable F>
using WaitableLambdaTask = _WaitableLambdaTask<SuspensionKind::Multiple, F>;
template <std::invocable F>
using WaitableLambdaTask_s = _WaitableLambdaTask<SuspensionKind::Single, F>;Template parameters
_SuspensionKindSuspensionKind- As for
WaitableTask. Fstd::invocable- Type of the stored callable: an object type invocable without arguments; it must not throw.
Remarks
The waitable counterpart of LambdaTask. Usually built by WaitableTask::Create; comes as WaitableLambdaTask and WaitableLambdaTask_s. The callable must not throw: an exception escaping it ends the process.
Names
| Name | Description |
|---|---|
WaitableLambdaTask |
WaitableLambdaTask for any number of waiting tasks.
|
WaitableLambdaTask_s |
WaitableLambdaTask for at most one waiting task at a time.
Cheaper, and Wait accepts a timeout; the waiter may destroy it as soon as Wait returned. |
Constructors
WaitableLambdaTask
Stores the callable.
Syntax
template <typename FF>
requires std::constructible_from<F, FF&&>
explicit WaitableLambdaTask(
FF&& func,
INotifyTaskStateChange* notifyTaskStateChange = nullptr
) noexcept;Template parameters
FFtypename- Type of the argument;
Fmust be constructible from it.
Parameters
funcFF&&- Copied or moved into
F. notifyTaskStateChangeINotifyTaskStateChange*- Told when the task exits; may be
nullptr.Default:nullptr
Methods
Run
Calls the stored callable.
Syntax
void Run() noexcept override;Generated from ThinkMeta.ConcurrentTasks.API @ e29892d (2026-10-30).