28#include "msgpack_rpc/impl/msgpack_rpc_export.h"
37class IAsyncExecutor :
public IExecutor {
73 std::function<
void(std::exception_ptr)> exception_callback) = 0;
85 IAsyncExecutor& operator=(
const IAsyncExecutor&) =
delete;
86 IAsyncExecutor& operator=(IAsyncExecutor&&) =
delete;
93 IAsyncExecutor() noexcept = default;
103[[nodiscard]] MSGPACK_RPC_EXPORT
std::shared_ptr<IAsyncExecutor>
IAsyncExecutor() noexcept=default
Constructor.
virtual std::exception_ptr last_exception()=0
Get the last exception thrown in asynchronous tasks.
virtual void stop()=0
Stops operation.
virtual void on_exception(std::function< void(std::exception_ptr)> exception_callback)=0
Register a function called when an exception is thrown in asynchronous tasks.
virtual bool is_running()=0
Check whether this executor is running.
virtual void start()=0
Start internal event loops to process asynchronous tasks.
~IAsyncExecutor() noexcept override=default
Destructor.
Definition of ExecutorConfig class.
Definition of IExecutor class.
Definition of Logger class.
Namespace of configurations.
Namespace of executors to process asynchronous tasks.
std::shared_ptr< IAsyncExecutor > create_executor(std::shared_ptr< logging::Logger > logger, const config::ExecutorConfig &config)
Create an executor.