![]() |
dfx 0.1.0
Linux-based dynamic dataflow executor
|
Interface for offloading task execution from the global pool to a specific node context. More...
#include <dfx-runtime-api/NodeTaskExecutor.hpp>
Public Member Functions | |
| virtual | ~NodeTaskExecutor ()=default |
| Virtual destructor. | |
| virtual bool | pushTask (TaskPtr task)=0 |
| Pushes a task into the node's private execution queue. | |
| virtual std::size_t | pushTasks (std::span< TaskPtr > tasks)=0 |
| Pushes a list of task into the node's private execution queue. | |
Interface for offloading task execution from the global pool to a specific node context.
Some nodes require strict thread affinity or internal synchronization that is incompatible with the default runtime thread pool. By implementing this interface, a node can "hijack" its own task execution.
|
virtualdefault |
Virtual destructor.
|
pure virtual |
Pushes a task into the node's private execution queue.
This method is called by the dfx::Runtime::Api::NodeReactor when an event associated with the node triggers. It is expected to be non-blocking and thread-safe, as it will typically be called from the reactor's polling thread.
| task | The task to be executed by the node. |
Implemented in dfx::Core::CustomExecutor, and dfx::Plugins::CNodeExecutor.
|
pure virtual |
Pushes a list of task into the node's private execution queue.
This method is similar to pushTask but can push more than 1 task at a time which may allow for locking optimization.
| tasks | The list of tasks to be executed by the node. |
Implemented in dfx::Core::CustomExecutor, and dfx::Plugins::CNodeExecutor.