Loading...
Searching...
No Matches
caf::scheduler::abstract_coordinator Class Referenceabstract

A coordinator creates the workers, manages delayed sends and the central printer instance for `aout`. More...

`#include <abstract_coordinator.hpp>`

Inheritance diagram for caf::scheduler::abstract_coordinator:

## Public Types

enum | utility_actor_id : size_t { printer_id , max_id }
Public Types inherited from caf::actor_system::module
enum | id_t { scheduler , middleman , opencl_manager , openssl_manager , network_manager , num_ids }

## Public Member Functions

| abstract_coordinator (actor_system &sys)
actor | printer () const
| Returns a handle to the central printing actor.
size_t | num_utility_actors () const
| Returns the number of utility actors.
virtual void | enqueue (resumable *what)=0
| Puts what into the queue of a randomly chosen worker.
actor_system & | system ()
const actor_system_config & | config () const
size_t | max_throughput () const
size_t | num_workers () const
virtual bool | detaches_utility_actors () const
| Returns true if this scheduler detaches its utility actors.
void | start () override
| Starts any background threads needed by the module.
void | init (actor_system_config &cfg) override
| Allows the module to change the configuration of the actor system during startup.
id_t | id () const override
| Returns the identifier of this module.
void * | subtype_ptr () override
| Returns a pointer to the subtype.
virtual actor_clock & | clock () noexcept=0
Public Member Functions inherited from caf::actor_system::module
const char * | name () const noexcept
| Returns the human-redable name of the module.
virtual void | stop ()=0
| Stops all background threads of the module.

## Static Public Member Functions

static void | cleanup_and_release (resumable *)

## Protected Member Functions

void | stop_actors ()

## Protected Attributes

std::atomic< size_t > | next_worker_
| ID of the worker receiving the next enqueue (round-robin dispatch).
size_t | max_throughput_
| Number of messages each actor is allowed to consume per resume.
size_t | num_workers_
| Configured number of workers.
std::array< actor, max_id > | utility_actors_
| Background workers, e.g., printer.
actor_system & | system_
| Reference to the host system.

## Detailed Description

A coordinator creates the workers, manages delayed sends and the central printer instance for `aout`.

It also forwards sends from detached workers or non-actor threads to randomly chosen workers.

## Member Function Documentation

## detaches_utility_actors()

virtual bool caf::scheduler::abstract_coordinator::detaches_utility_actors | ( |  | ) | const

virtual

Returns true if this scheduler detaches its utility actors.

Reimplemented in caf::scheduler::test_coordinator.

## enqueue()

virtual void caf::scheduler::abstract_coordinator::enqueue | ( | resumable * | what | ) |

pure virtual

Puts what into the queue of a randomly chosen worker.

Implemented in caf::scheduler::coordinator< Policy >, caf::scheduler::coordinator< Policy > *, caf::scheduler::coordinator< policy::profiled< policy::work_stealing > >, and caf::scheduler::test_coordinator.

## id()

id_t caf::scheduler::abstract_coordinator::id | ( |  | ) | const

override virtual

Returns the identifier of this module.

Implements caf::actor_system::module.

## init()

void caf::scheduler::abstract_coordinator::init | ( | actor_system_config & |  | ) |

override virtual

Allows the module to change the configuration of the actor system during startup.

Implements caf::actor_system::module.

Reimplemented in caf::scheduler::profiled_coordinator< Policy >, and caf::scheduler::profiled_coordinator< profiled< Policy > >.

## start()

void caf::scheduler::abstract_coordinator::start | ( |  | ) |

override virtual

Starts any background threads needed by the module.

Implements caf::actor_system::module.

Reimplemented in caf::scheduler::coordinator< Policy >, caf::scheduler::coordinator< Policy > *, caf::scheduler::coordinator< policy::profiled< policy::work_stealing > >, caf::scheduler::profiled_coordinator< Policy >, caf::scheduler::profiled_coordinator< profiled< Policy > >, and caf::scheduler::test_coordinator.

## subtype_ptr()

void * caf::scheduler::abstract_coordinator::subtype_ptr | ( |  | ) |

override virtual

Returns a pointer to the subtype.

Implements caf::actor_system::module.

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

- /build/actor-framework-Z9pIPl/actor-framework-0.17.6/libcaf_core/caf/scheduler/abstract_coordinator.hpp