CAF
0.17.6
|
A registry is used to associate actors to IDs or atoms (names). More...
#include <actor_registry.hpp>
Public Types | |
using | name_map = std::unordered_map< atom_value, strong_actor_ptr > |
Public Member Functions | |
template<class T = strong_actor_ptr> | |
T | get (actor_id key) const |
Returns the local actor associated to key . | |
template<class T > | |
void | put (actor_id key, const T &val) |
Associates a local actor with its ID. | |
void | erase (actor_id key) |
Removes an actor from this registry, leaving reason for future reference. More... | |
void | inc_running () |
Increases running-actors-count by one. | |
void | dec_running () |
Decreases running-actors-count by one. | |
size_t | running () const |
Returns the number of currently running actors. | |
void | await_running_count_equal (size_t expected) const |
Blocks the caller until running-actors-count becomes expected (must be either 0 or 1). More... | |
template<class T = strong_actor_ptr> | |
T | get (atom_value key) const |
Returns the actor associated with key or invalid_actor . | |
template<class T > | |
void | put (atom_value key, const T &value) |
Associates given actor to key . | |
void | erase (atom_value key) |
Removes a name mapping. | |
name_map | named_actors () const |
Friends | |
class | actor_system |
A registry is used to associate actors to IDs or atoms (names).
This allows a middleman to lookup actor handles after receiving actor IDs via the network and enables developers to use well-known names to identify important actors independent from their ID at runtime. Note that the registry does not contain all actors of an actor system. The middleman registers actors as needed.
void caf::actor_registry::await_running_count_equal | ( | size_t | expected | ) | const |
Blocks the caller until running-actors-count becomes expected
(must be either 0 or 1).
void caf::actor_registry::erase | ( | actor_id | key | ) |
Removes an actor from this registry, leaving reason
for future reference.