ledger-core
Public Member Functions | List of all members
ledger::core::api::ThreadDispatcher Class Referenceabstract

#include <ThreadDispatcher.hpp>

Public Member Functions

virtual std::shared_ptr< ExecutionContextgetSerialExecutionContext (const std::string &name)=0
 
virtual std::shared_ptr< ExecutionContextgetThreadPoolExecutionContext (const std::string &name)=0
 
virtual std::shared_ptr< ExecutionContextgetMainExecutionContext ()=0
 
virtual std::shared_ptr< LocknewLock ()=0
 

Detailed Description

Class representing a thread dispatcher

Member Function Documentation

◆ getMainExecutionContext()

virtual std::shared_ptr<ExecutionContext> ledger::core::api::ThreadDispatcher::getMainExecutionContext ( )
pure virtual

Get main execution context (generally where tasks that should never get blocked are executed)

Returns
ExecutionContext object

◆ getSerialExecutionContext()

virtual std::shared_ptr<ExecutionContext> ledger::core::api::ThreadDispatcher::getSerialExecutionContext ( const std::string &  name)
pure virtual

Get an execution context where tasks are executed sequentially

Parameters
name,string,nameof execution context to retrieve
Returns
ExecutionContext object

◆ getThreadPoolExecutionContext()

virtual std::shared_ptr<ExecutionContext> ledger::core::api::ThreadDispatcher::getThreadPoolExecutionContext ( const std::string &  name)
pure virtual

Get an execution context where tasks are executed in parallel thanks to a thread pool where a system of inter-thread communication was designed

Parameters
name,string,nameof execution context to retrieve
Returns
ExecutionContext object

◆ newLock()

virtual std::shared_ptr<Lock> ledger::core::api::ThreadDispatcher::newLock ( )
pure virtual

Get lock to handle multithreading

Returns
Lock object

The documentation for this class was generated from the following file: