NebulaStream
0.6.213
NebulaStream is a data and application management framework for the internet of things
|
This is a multi-threaded task executor that execute asynchronously tasks. Submitted task are paired to a future value that can be retrieved when the async task is executed. More...
#include <AsyncTaskExecutor.hpp>
Classes | |
class | AsyncTaskFuture |
This is a future that the async executor returns, which can be retrieved using .wait() More... | |
Public Member Functions | |
AsyncTaskExecutor (const HardwareManagerPtr &hardwareMananger, uint32_t numOfThreads=1) | |
Creates an AsyncTaskExecutor using numOfThreads threads. More... | |
~AsyncTaskExecutor () | |
destructor to clean up inner resources More... | |
bool | destroy () |
Method to clean up the internal resources (called by the destructor). Only the first invocation cleans inner resources. Subsequent calls won't produced any effect. More... | |
template<class Function , class... Args> | |
AsyncTaskFuture< std::invoke_result_t< std::decay_t< Function >, std::decay_t< Args >... > > | runAsync (Function &&f, Args &&... args) |
Submits an async task to the executor to be executed in the future. More... | |
This is a multi-threaded task executor that execute asynchronously tasks. Submitted task are paired to a future value that can be retrieved when the async task is executed.
|
explicit |
Creates an AsyncTaskExecutor using numOfThreads
threads.
numOfThreads | the number of threads to use for the executor |
References NES_ASSERT, and NES::setThreadName().
NES::Runtime::AsyncTaskExecutor::~AsyncTaskExecutor | ( | ) |
destructor to clean up inner resources
References destroy().
bool NES::Runtime::AsyncTaskExecutor::destroy | ( | ) |
Method to clean up the internal resources (called by the destructor). Only the first invocation cleans inner resources. Subsequent calls won't produced any effect.
References NES_ASSERT.
Referenced by ~AsyncTaskExecutor().
|
inline |
Submits an async task to the executor to be executed in the future.
f | function to execute |
args | its arguments |
References backward::details::move(), and NES_ASSERT.
Referenced by NES::Runtime::AsyncTaskExecutor::AsyncTaskFuture< R >::thenAsync().