Commit 641db02e authored by Dominik Charousset's avatar Dominik Charousset

Make `congested` noexcept and implement it

parent ca972736
...@@ -89,9 +89,8 @@ public: ...@@ -89,9 +89,8 @@ public:
return make_message_from_tuple(driver_.make_handshake(slot)); return make_message_from_tuple(driver_.make_handshake(slot));
} }
bool congested() const override { bool congested() const noexcept override {
// TODO: implement me return out_.capacity() == 0;
return out_.buffered() >= 30;
} }
private: private:
......
...@@ -94,7 +94,7 @@ public: ...@@ -94,7 +94,7 @@ public:
/// Returns true if the handler is not able to process any further batches /// Returns true if the handler is not able to process any further batches
/// since it is unable to make progress sending on its own. /// since it is unable to make progress sending on its own.
virtual bool congested() const; virtual bool congested() const noexcept;
/// Sends a handshake to `dest`. /// Sends a handshake to `dest`.
/// @pre `dest != nullptr` /// @pre `dest != nullptr`
......
...@@ -116,7 +116,7 @@ void stream_manager::push() { ...@@ -116,7 +116,7 @@ void stream_manager::push() {
} while (generate_messages()); } while (generate_messages());
} }
bool stream_manager::congested() const { bool stream_manager::congested() const noexcept {
return false; return false;
} }
......
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