One bounded, pre-warmed audio-to-worker task lane. More...
#include <background_task_lane.hpp>
Public Types | |
| using | Handler = void (*)(void*, const Task&) |
| using | HandlerFunction = runtime::FixedFunction<void(const Task&), 48> |
Public Member Functions | |
| BackgroundTaskLane ()=default | |
| ~BackgroundTaskLane () | |
| BackgroundTaskLane (const BackgroundTaskLane &)=delete | |
| BackgroundTaskLane & | operator= (const BackgroundTaskLane &)=delete |
| bool | start (Handler handler, void *context=nullptr, BackgroundTaskPolicy policy=BackgroundTaskPolicy::Ordered) |
| bool | start (HandlerFunction handler, BackgroundTaskPolicy policy=BackgroundTaskPolicy::Ordered) |
| void | stop () noexcept |
| bool | try_spawn (const Task &task) noexcept |
| bool | running () const noexcept |
| std::uint64_t | overflow_count () const noexcept |
One bounded, pre-warmed audio-to-worker task lane.
start()/stop() are control-thread operations. try_spawn() is lock-free and allocation-free after start. A lane has one consumer, so its handler is never re-entered; independent lanes run concurrently. Latest policy coalesces bursts to the newest trivially-copyable task.
The handler is a runtime::FixedFunction, so a capturing lambda is stored inline: no void* context to cast and no allocation, ever. An older function-pointer-and-context pair is still accepted.
| using pulp::format::BackgroundTaskLane< Task, Capacity >::Handler = void (*)(void*, const Task&) |
| using pulp::format::BackgroundTaskLane< Task, Capacity >::HandlerFunction = runtime::FixedFunction<void(const Task&), 48> |
|
default |
|
inline |
|
delete |
|
delete |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |