void abstract_scheduled_actor::request_timeout(util::duration const& d)
{
    if (d.valid())
    {
        future_send(this, d, atom(":Timeout"), ++m_active_timeout_id);
        m_has_pending_timeout_request = true;
    }
}
 void request_timeout(const util::duration& d) {
     if (d.valid()) {
         if (d.is_zero()) {
             // immediately enqueue timeout
             enqueue(nullptr, make_any_tuple(atom("TIMEOUT"),
                                             ++m_active_timeout_id));
         }
         else {
             get_scheduler()->delayed_send(this, d, atom("TIMEOUT"),
                                           ++m_active_timeout_id);
         }
         m_has_pending_timeout_request = true;
     }
     else m_has_pending_timeout_request = false;
 }
Esempio n. 3
0
 void request_timeout(const util::duration& d) {
     if (d.valid()) {
         m_has_timeout = true;
         auto tid = ++m_timeout_id;
         auto msg = make_any_tuple(timeout_msg{tid});
         if (d.is_zero()) {
             // immediately enqueue timeout message if duration == 0s
             this->enqueue({this->address(), this}, std::move(msg),
                           this->m_host);
             //auto e = this->new_mailbox_element(this, std::move(msg));
             //this->m_mailbox.enqueue(e);
         }
         else this->delayed_send_tuple(this, d, std::move(msg));
     }
     else m_has_timeout = false;
 }