void default_actor_addressing::erase(process_information& inf, actor_id aid) {
    CPPA_LOGMF(CPPA_TRACE, self, CPPA_TARG(inf, to_string) << ", " << CPPA_ARG(aid));
    auto i = m_proxies.find(inf);
    if (i != m_proxies.end()) {
        i->second.erase(aid);
    }
}
actor_ptr default_actor_addressing::get_or_put(const process_information& inf,
        actor_id aid) {
    auto result = get(inf, aid);
    if (result == nullptr) {
        CPPA_LOGMF(CPPA_INFO, self, "created new proxy instance; "
                   << CPPA_TARG(inf, to_string) << ", " << CPPA_ARG(aid));
        auto ptr = make_counted<default_actor_proxy>(aid, new process_information(inf), m_parent);
        put(inf, aid, ptr);
        result = ptr;
    }
    return result;
}
void publish_impl(abstract_actor_ptr ptr, std::unique_ptr<acceptor> aptr) {
    // begin the scenes, we serialze/deserialize as actor
    actor whom{raw_access::unsafe_cast(ptr.get())};
    CPPA_LOGF_TRACE(CPPA_TARG(whom, to_string) << ", " << CPPA_MARG(aptr, get));
    if (!whom) return;
    get_actor_registry()->put(whom->id(), detail::raw_access::get(whom));
    auto mm = get_middleman();
    auto addr = whom.address();
    auto sigs = whom->interface();
    mm->register_acceptor(addr, new peer_acceptor(mm, move(aptr),
                                                  addr, move(sigs)));
}
actor_ptr default_actor_addressing::get(const process_information& inf,
                                        actor_id aid) {
    auto& submap = m_proxies[inf];
    auto i = submap.find(aid);
    if (i != submap.end()) {
        auto result = i->second.promote();
        CPPA_LOGMF_IF(!result, CPPA_INFO, self, "proxy instance expired; "
                      << CPPA_TARG(inf, to_string) << ", "<< CPPA_ARG(aid));
        if (!result) submap.erase(i);
        return result;
    }
    return nullptr;
}
void default_actor_addressing::erase(process_information& inf) {
    CPPA_LOGMF(CPPA_TRACE, self, CPPA_TARG(inf, to_string));
    m_proxies.erase(inf);
}
void middleman_event_handler::add_later(continuable* ptr, event_bitmask e) {
    CPPA_LOG_TRACE(CPPA_ARG(ptr) << ", "
                   << CPPA_TARG(e, eb2str)
                   << ", socket = " << ptr->read_handle());
    alteration(ptr, e, fd_meta_event::add);
}