aboutsummaryrefslogtreecommitdiff
path: root/client-native-lib
diff options
context:
space:
mode:
Diffstat (limited to 'client-native-lib')
-rw-r--r--client-native-lib/Cargo.toml2
-rw-r--r--client-native-lib/src/instance.rs14
2 files changed, 10 insertions, 6 deletions
diff --git a/client-native-lib/Cargo.toml b/client-native-lib/Cargo.toml
index ea36db9..152ae2a 100644
--- a/client-native-lib/Cargo.toml
+++ b/client-native-lib/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "libkeks"
-version = "0.2.3"
+version = "0.3.0"
edition = "2021"
[dependencies]
diff --git a/client-native-lib/src/instance.rs b/client-native-lib/src/instance.rs
index 899e48c..476d9bd 100644
--- a/client-native-lib/src/instance.rs
+++ b/client-native-lib/src/instance.rs
@@ -181,11 +181,15 @@ impl Instance {
.await
.insert(res.info().id, res);
}
- pub async fn remove_local_resource(&self, id: String) {
- self.local_resources.write().await.remove(&id);
- for (_pid, peer) in self.peers.read().await.iter() {
- peer.send_relay(RelayMessage::ProvideStop { id: id.clone() })
- .await;
+ pub async fn remove_local_resource(&self, id: String) -> bool {
+ if let Some(_) = self.local_resources.write().await.remove(&id) {
+ for (_pid, peer) in self.peers.read().await.iter() {
+ peer.send_relay(RelayMessage::ProvideStop { id: id.clone() })
+ .await;
+ }
+ true
+ } else {
+ false
}
}
}