ecor
Loading...
Searching...
No Matches
ecor::task_holder< CFG, Ctx, Factory > Struct Template Reference

Owns a task<void, CFG> that restarts automatically, it is provided with a factory to create new task instances, and a context that is passed to the factory on each run. More...

#include <ecor.hpp>

Public Types

using base = _task_holder_base< CFG >
 

Public Member Functions

 task_holder (Ctx &ctx, Factory factory)
 

Detailed Description

template<task_config CFG = task_default_cfg, task_context Ctx = task_ctx, typename Factory = void>
struct ecor::task_holder< CFG, Ctx, Factory >

Owns a task<void, CFG> that restarts automatically, it is provided with a factory to create new task instances, and a context that is passed to the factory on each run.

Restart policy:

  • Restarts on set_value, set_error, or set_stopped from the inner task.
  • Exits the loop only when stop() has been called AND the next completion arrives (regardless of which signal it is).

Template parameters:

  • CFG — task configuration, default task_default_cfg
  • Ctx — task context type satisfying task_context, default task_ctx
  • Factory — callable (Ctx&) -> task<void, CFG>; deduced via CTAD

Precondition: must not be destructed before the sender returned by stop() completes.


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