194 static constexpr
int kInfinite{-1};
241 [[nodiscard]]
bool valid() const noexcept;
256 [[nodiscard]]
bool is_done() const noexcept;
293 bool wait(
int timeout_ms = kInfinite) const;
298 explicit
TaskHandle(std::shared_ptr<State> state) noexcept;
304 static void mark_task_queued(
const TaskHandle& handle);
306 static void mark_task_rejected(
const TaskHandle& handle);
308 static bool begin_task_execution(
const TaskHandle& handle);
310 static void complete_task_execution(
const TaskHandle& handle);
312 static void fail_task_execution(
const TaskHandle& handle);
314 static void drop_task_if_queued(
const TaskHandle& handle);
316 static bool request_cancel(std::shared_ptr<State> state);
318 std::shared_ptr<State> state_;
322 friend class TrackedTask;
Cooperative one-shot cancellation primitives shared by VLink async building blocks.
Lightweight observer of a CancellationSource shared across worker threads.
Definition: cancellation.h:174
Serial task dispatcher with selectable queue backend and bounded timer registry.
Definition: message_loop.h:126
Move-only type-erased callable analogue of std::move_only_function with pool spill.
Definition: functional.h:134
Shared observable handle returned by tracked posting APIs.
Definition: task_handle.h:189
TaskHandle() noexcept
Constructs an invalid handle that references no task.
Fixed worker pool that consumes a shared task queue.
Definition: thread_pool.h:103
Pool-backed type-erased callables: copyable vlink::Function and move-only vlink::MoveFunction.
Cross-platform macros for visibility, branch hints, copy prevention, singletons and string helpers.
#define VLINK_EXPORT
Definition: macros.h:81
TaskDropPolicy
Whether an accepted task may later be discarded by drop-oldest overflow paths.
Definition: task_handle.h:142
@ kDroppable
The task is a valid drop candidate.
TaskExecutionState
Observable lifecycle stage of a tracked task.
Definition: task_handle.h:109
@ kQueued
Non-terminal: dispatcher accepted the task but has not yet run it.
@ kDropped
Terminal: task was removed from a bounded queue before execution.
@ kRunning
Non-terminal: task callback is currently executing.
@ kCompleted
Terminal: callback returned normally.
@ kCancelled
Terminal: task was cancelled before its callback executed.
@ kInvalid
Non-terminal: empty handle or no associated task yet.
@ kFailed
Terminal: task callback raised an exception.
@ kRejected
Terminal: dispatcher refused the submission (quitting / queue full).
TaskOverflowPolicy
Per-post override for the bounded-queue overflow strategy.
Definition: task_handle.h:128
@ kUseDispatcherStrategy
Inherit the dispatcher-configured overflow strategy.
@ kReject
Return a rejected handle immediately when the queue is full.
@ kBlock
Block until queue space appears or the dispatcher quits.
Bundle of optional knobs accepted by tracked task-posting APIs.
Definition: task_handle.h:156
CancellationToken cancellation_token
Parent cancellation token that can request abort of this submission.
Definition: task_handle.h:167