Commit 11852b66 authored by Dominik Charousset's avatar Dominik Charousset

mark replied message to avoid unnecessary empty reply messages

parent aa9f724f
...@@ -107,16 +107,21 @@ void local_actor::reply_message(any_tuple&& what) { ...@@ -107,16 +107,21 @@ void local_actor::reply_message(any_tuple&& what) {
if (whom == nullptr) { if (whom == nullptr) {
return; return;
} }
auto id = m_current_node->mid; auto& id = m_current_node->mid;
if (id.valid() == false || id.is_response()) { if (id.valid() == false || id.is_response()) {
send_message(whom.get(), std::move(what)); send_message(whom.get(), std::move(what));
} }
else if (chaining_enabled()) { else {
if (chaining_enabled()) {
if (whom->chained_sync_enqueue(this, id.response_id(), std::move(what))) { if (whom->chained_sync_enqueue(this, id.response_id(), std::move(what))) {
m_chained_actor = whom; m_chained_actor = whom;
} }
} }
else whom->sync_enqueue(this, id.response_id(), std::move(what)); else {
whom->sync_enqueue(this, id.response_id(), std::move(what));
}
id.mark_as_answered();
}
} }
void local_actor::forward_message(const actor_ptr& new_receiver) { void local_actor::forward_message(const actor_ptr& new_receiver) {
......
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