dfx 0.1.0
Linux-based dynamic dataflow executor
Loading...
Searching...
No Matches
CustomExecutor.hpp
1// SPDX-FileCopyrightText: 2026 Vincent Leroy
2// SPDX-License-Identifier: MIT
3//
4// This file is part of dfx.
5//
6// Licensed under the MIT License. See the LICENSE file in the project root
7// for full license information.
8
9#pragma once
10
11// Project includes
12#include <dfx-runtime-api/NodeTaskExecutor.hpp>
13#include <dfx-utilities/sync-queues/PriorityStableQueue.hpp>
14
15namespace dfx::Core
16{
32{
33public:
41 bool pushTask(Runtime::Api::TaskPtr task) override;
42
50 std::size_t pushTasks(std::span<Runtime::Api::TaskPtr> tasks) override;
51
58
63
64private:
66};
67} // !namespace dfx::Core
A priority-aware implementation of the NodeTaskExecutor interface.
Definition CustomExecutor.hpp:32
void processAllPendingTasks()
Drains the entire queue, executing all pending tasks in priority order.
bool pushTask(Runtime::Api::TaskPtr task) override
Pushes a task into the priority-stable execution queue.
void processNextTask()
Consumes and executes the single highest-priority task currently in the queue.
std::size_t pushTasks(std::span< Runtime::Api::TaskPtr > tasks) override
Pushes a batch of tasks into the execution queue.
Interface for offloading task execution from the global pool to a specific node context.
Definition NodeTaskExecutor.hpp:41
A thread-safe, priority-based queue that maintains insertion order for equal priorities.
Definition PriorityStableQueue.hpp:50
Definition Channel.hpp:25
std::unique_ptr< Task > TaskPtr
Unique ownership pointer for tasks.
Definition Task.hpp:102