Commit 9d24c002 authored by Dominik Charousset's avatar Dominik Charousset

Add dequeue customization point to blocking_actor

parent b9f677ee
......@@ -311,6 +311,10 @@ public:
/// the absolute `timeout` was reached.
virtual bool await_data(timeout_type timeout);
/// Returns the next element from the mailbox or `nullptr`.
/// The default implementation simply returns `next_message()`.
virtual mailbox_element_ptr dequeue();
/// @cond PRIVATE
/// Receives messages until either a pre- or postcheck of `rcc` fails.
......
......@@ -230,7 +230,7 @@ public:
}
mailbox_element& value() override {
ptr_ = self_->next_message();
ptr_ = self_->dequeue();
CAF_ASSERT(ptr_ != nullptr);
return *ptr_;
}
......@@ -390,6 +390,10 @@ bool blocking_actor::await_data(timeout_type timeout) {
return mailbox().synchronized_await(mtx_, cv_, timeout);
}
mailbox_element_ptr blocking_actor::dequeue() {
return next_message();
}
size_t blocking_actor::attach_functor(const actor& x) {
return attach_functor(actor_cast<strong_actor_ptr>(x));
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment