YACLib
C++ library for concurrent tasks execution
Loading...
Searching...
No Matches
yaclib::IExecutor Class Referenceabstract

#include <executor.hpp>

Inheritance diagram for yaclib::IExecutor:
[legend]
Collaboration diagram for yaclib::IExecutor:
[legend]

Public Types

enum class  Type : unsigned char {
  Custom = 0 , Inline = 1 , Manual = 2 , Strand = 3 ,
  SingleThread = 4 , FairThreadPool = 5 , GolangThreadPool = 6
}
 

Public Member Functions

virtual Type Tag () const noexcept=0
 Return type of this executor.
 
virtual bool Alive () const noexcept=0
 Return true if executor still alive, that means job passed to submit will be Call.
 
virtual void Submit (Job &job) noexcept=0
 Submit given job.
 
- Public Member Functions inherited from yaclib::IRef
virtual void IncRef () noexcept
 Increments reference counter.
 
virtual void DecRef () noexcept
 Decrements reference counter.
 
virtual ~IRef () noexcept=default
 

Detailed Description

Definition at line 8 of file executor.hpp.

Member Enumeration Documentation

◆ Type

Enumerator
Custom 
Inline 
Manual 
Strand 
SingleThread 
FairThreadPool 
GolangThreadPool 

Definition at line 23 of file executor.hpp.

Member Function Documentation

◆ Alive()

virtual bool yaclib::IExecutor::Alive ( ) const
pure virtualnoexcept

Return true if executor still alive, that means job passed to submit will be Call.

Implemented in yaclib::ManualExecutor, yaclib::Strand, and yaclib::FairThreadPool.

Referenced by yaclib::Strand::Alive().

◆ Submit()

virtual void yaclib::IExecutor::Submit ( Job job)
pure virtualnoexcept

Submit given job.

This method may either Call or Drop the job

This method increments reference counter if task is submitted.

Call if executor is Alive, otherwise Drop

Parameters
jobjob to execute

Implemented in yaclib::ManualExecutor, yaclib::Strand, and yaclib::FairThreadPool.

Referenced by yaclib::detail::MutexImpl< FIFO, Batching >::AwaitUnlockOn(), and yaclib::detail::MutexImpl< FIFO, Batching >::UnlockHereAwait().

◆ Tag()

virtual Type yaclib::IExecutor::Tag ( ) const
pure virtualnoexcept

Return type of this executor.

Implemented in yaclib::ManualExecutor, yaclib::Strand, and yaclib::FairThreadPool.


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