void actor_registry::put_named(atom_value key, actor value) { if (value) value->attach_functor([=](uint32_t) { detail::singletons::get_actor_registry()->put_named(key, invalid_actor); }); exclusive_guard guard{named_entries_mtx_}; named_entries_.emplace(key, std::move(value)); }
// utility function to print an exit message with custom name void print_on_exit(const actor& hdl, const std::string& name) { hdl->attach_functor([=](abstract_actor* ptr, uint32_t reason) { aout(ptr) << name << " exited with reason " << reason << endl; }); }
// utility function to print an exit message with custom name void print_on_exit(const actor& ptr, const std::string& name) { ptr->attach_functor([=](uint32_t reason) { aout(ptr) << name << " exited with reason " << reason << endl; }); }