Commit 67d41064 authored by Dominik Charousset's avatar Dominik Charousset

Add `num_streams` function to stream multiplexer

parent c295d419
...@@ -138,10 +138,15 @@ public: ...@@ -138,10 +138,15 @@ public:
stream_multiplexer(local_actor* self, backend& service); stream_multiplexer(local_actor* self, backend& service);
/// Queries whether stream `x` is managed by this multiplexer. /// Queries whether stream `x` is managed by this multiplexer.
bool has_stream(const stream_id& x) const { inline bool has_stream(const stream_id& x) const {
return streams_.count(x) > 0; return streams_.count(x) > 0;
} }
/// Queries the number of open streams.
inline size_t num_streams() const {
return streams_.size();
}
protected: protected:
// Dispatches `x` on the subtype `T`. // Dispatches `x` on the subtype `T`.
template <class T> template <class T>
......
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