Skip to content

Commit c1bb944

Browse files
committed
deprecate set(get)_variable
1 parent ab4cf46 commit c1bb944

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/extensions/variable_transfer.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ mod tls_utils;
77
type Error = Box<dyn std::error::Error + Send + Sync + 'static>;
88

99
impl crate::application::CoLink {
10+
#[deprecated(note = "please use `send_variable` instead")]
1011
pub async fn set_variable(
1112
&self,
1213
key: &str,
@@ -37,7 +38,7 @@ impl crate::application::CoLink {
3738
.await
3839
.is_err()
3940
{
40-
cl.set_variable_with_remote_storage(&key, &payload, &[receiver.clone()])
41+
cl.send_variable_with_remote_storage(&key, &payload, &[receiver.clone()])
4142
.await?;
4243
}
4344
Ok::<(), Box<dyn std::error::Error + Send + Sync + 'static>>(())
@@ -46,6 +47,7 @@ impl crate::application::CoLink {
4647
Ok(())
4748
}
4849

50+
#[deprecated(note = "please use `receive_variable` instead")]
4951
pub async fn get_variable(&self, key: &str, sender: &Participant) -> Result<Vec<u8>, Error> {
5052
self.receive_variable(key, sender).await
5153
}
@@ -61,7 +63,9 @@ impl crate::application::CoLink {
6163
if let Ok(res) = self._receive_variable_p2p(key, sender).await {
6264
return Ok(res);
6365
}
64-
let res = self.get_variable_with_remote_storage(key, sender).await?;
66+
let res = self
67+
.receive_variable_with_remote_storage(key, sender)
68+
.await?;
6569
Ok(res)
6670
}
6771
}

src/extensions/variable_transfer/remote_storage.rs

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ mod colink_remote_storage {
88
type Error = Box<dyn std::error::Error + Send + Sync + 'static>;
99

1010
impl crate::application::CoLink {
11+
#[deprecated(note = "please use `send_variable_with_remote_storage` instead")]
1112
pub async fn set_variable_with_remote_storage(
1213
&self,
1314
key: &str,
@@ -59,6 +60,7 @@ impl crate::application::CoLink {
5960
Ok(())
6061
}
6162

63+
#[deprecated(note = "please use `receive_variable_with_remote_storage` instead")]
6264
pub async fn get_variable_with_remote_storage(
6365
&self,
6466
key: &str,

0 commit comments

Comments
 (0)