mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-11 16:31:07 +00:00
Don't queue messages after shutdown (#1476)
This commit is contained in:
@@ -103,10 +103,15 @@ impl<TSubstream> RegisteredProtocolSubstream<TSubstream> {
|
||||
/// After calling this, the stream is guaranteed to finish soon-ish.
|
||||
pub fn shutdown(&mut self) {
|
||||
self.is_closing = true;
|
||||
self.send_queue.clear();
|
||||
}
|
||||
|
||||
/// Sends a message to the substream.
|
||||
pub fn send_message(&mut self, data: Bytes) {
|
||||
if self.is_closing {
|
||||
return
|
||||
}
|
||||
|
||||
self.send_queue.push_back(data);
|
||||
|
||||
// If the length of the queue goes over a certain arbitrary threshold, we print a warning.
|
||||
|
||||
Reference in New Issue
Block a user