Executor#

Interface#

static constexpr uint32_t paimon::DEFAULT_EXECUTOR_THREAD_COUNT = 4#
std::shared_ptr<Executor> paimon::GetGlobalDefaultExecutor()#

Get a system wide singleton executor.

std::unique_ptr<Executor> paimon::CreateDefaultExecutor()#

Create a default implementation of executor with DEFAULT_EXECUTOR_THREAD_COUNT.

std::unique_ptr<Executor> paimon::CreateDefaultExecutor(uint32_t thread_count)#

Create a default implementation of executor with specified thread_count.

class Executor#

Interface class for defining basic operations of a task executor.

The Executor class provides interfaces for adding tasks and waiting for all tasks to complete.

Public Functions

virtual ~Executor() = default#
virtual void Add(std::function<void()> func) = 0#

Add a task to the executor.

Note

This method should be thread-safe and can be called from multiple threads simultaneously.

Parameters:

func – The task to be executed, represented as a function object with no parameters and no return value.