Commit 566b6642 authored by Dominik Charousset's avatar Dominik Charousset

Backport downstream manager fix from 0.18

parent a0f4966e
...@@ -65,6 +65,16 @@ public: ...@@ -65,6 +65,16 @@ public:
// -- properties ------------------------------------------------------------- // -- properties -------------------------------------------------------------
template <class... Ts>
bool push_to(stream_slot slot, Ts&&... xs) {
auto i = states().find(slot);
if (i != states().end()) {
i->second.buf.emplace_back(std::forward<Ts>(xs)...);
return true;
}
return false;
}
size_t buffered() const noexcept override { size_t buffered() const noexcept override {
// We have a central buffer, but also an additional buffer at each path. We // We have a central buffer, but also an additional buffer at each path. We
// return the maximum size to reflect the current worst case. // return the maximum size to reflect the current worst case.
......
...@@ -256,6 +256,16 @@ public: ...@@ -256,6 +256,16 @@ public:
return result; return result;
} }
size_t buffered(stream_slot slot) const noexcept override {
// We don't know which nested manager stores this path. Only one will give a
// valid answer, though. Everyone else always responds with 0. Hence, we can
// simply call all managers and sum up the results.
size_t result = 0;
for (auto ptr : ptrs_)
result += ptr->buffered(slot);
return result;
}
void clear_paths() override { void clear_paths() override {
CAF_LOG_TRACE(""); CAF_LOG_TRACE("");
for (auto ptr : ptrs_) for (auto ptr : ptrs_)
......
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