aboutsummaryrefslogtreecommitdiffstats
path: root/filamento/src/logic/abort.rs
diff options
context:
space:
mode:
Diffstat (limited to 'filamento/src/logic/abort.rs')
-rw-r--r--filamento/src/logic/abort.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/filamento/src/logic/abort.rs b/filamento/src/logic/abort.rs
new file mode 100644
index 0000000..32c4823
--- /dev/null
+++ b/filamento/src/logic/abort.rs
@@ -0,0 +1,10 @@
+use lampada::error::ReadError;
+
+use super::ClientLogic;
+
+pub async fn on_abort(logic: ClientLogic) {
+ let mut iqs = logic.pending().lock().await;
+ for (_id, sender) in iqs.drain() {
+ let _ = sender.send(Err(ReadError::LostConnection));
+ }
+}