mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-12 21:32:40 +00:00
Allow cleaning up connections/handlers state using Peer::reset
This commit is contained in:
parent
ce2f3f664a
commit
779dbf86dd
1 changed files with 7 additions and 0 deletions
|
@ -148,6 +148,13 @@ impl Peer {
|
|||
.remove(&connection_id);
|
||||
}
|
||||
|
||||
pub async fn reset(&self) {
|
||||
self.connections.write().await.clear();
|
||||
self.connection_close_barriers.write().await.clear();
|
||||
self.handler_types.lock().await.clear();
|
||||
self.message_handlers.write().await.clear();
|
||||
}
|
||||
|
||||
pub fn handle_messages(
|
||||
self: &Arc<Self>,
|
||||
connection_id: ConnectionId,
|
||||
|
|
Loading…
Reference in a new issue