Skip to content

Commit e1435d0

Browse files
committed
renaming
1 parent 9f67705 commit e1435d0

File tree

5 files changed

+13
-19
lines changed

5 files changed

+13
-19
lines changed

examples/protocol_variable_transfer.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ impl ProtocolEntry for Receiver {
2626
param: Vec<u8>,
2727
participants: Vec<Participant>,
2828
) -> Result<(), Box<dyn std::error::Error + Send + Sync + 'static>> {
29-
let msg = cl.receive_variable("output", &participants[0]).await?;
29+
let msg = cl.recv_variable("output", &participants[0]).await?;
3030
println!("{}", String::from_utf8_lossy(&msg));
3131
cl.create_entry(&format!("tasks:{}:output", cl.get_task_id()?), &msg)
3232
.await?;

src/extensions/variable_transfer.rs

+5-11
Original file line numberDiff line numberDiff line change
@@ -47,25 +47,19 @@ impl crate::application::CoLink {
4747
Ok(())
4848
}
4949

50-
#[deprecated(note = "please use `receive_variable` instead")]
50+
#[deprecated(note = "please use `recv_variable` instead")]
5151
pub async fn get_variable(&self, key: &str, sender: &Participant) -> Result<Vec<u8>, Error> {
52-
self.receive_variable(key, sender).await
52+
self.recv_variable(key, sender).await
5353
}
5454

55-
pub async fn receive_variable(
56-
&self,
57-
key: &str,
58-
sender: &Participant,
59-
) -> Result<Vec<u8>, Error> {
55+
pub async fn recv_variable(&self, key: &str, sender: &Participant) -> Result<Vec<u8>, Error> {
6056
if self.task_id.is_empty() {
6157
Err("task_id not found".to_string())?;
6258
}
63-
if let Ok(res) = self._receive_variable_p2p(key, sender).await {
59+
if let Ok(res) = self._recv_variable_p2p(key, sender).await {
6460
return Ok(res);
6561
}
66-
let res = self
67-
.receive_variable_with_remote_storage(key, sender)
68-
.await?;
62+
let res = self.recv_variable_with_remote_storage(key, sender).await?;
6963
Ok(res)
7064
}
7165
}

src/extensions/variable_transfer/p2p_inbox.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ impl crate::application::CoLink {
165165
.contains_key(&receiver.user_id)
166166
{
167167
let inbox = self
168-
.receive_variable_with_remote_storage("inbox", receiver)
168+
.recv_variable_with_remote_storage("inbox", receiver)
169169
.await?;
170170
let inbox: VTInbox = serde_json::from_slice(&inbox)?;
171171
let inbox = if inbox.addr.is_empty() {
@@ -218,7 +218,7 @@ impl crate::application::CoLink {
218218
Ok(())
219219
}
220220

221-
pub(crate) async fn _receive_variable_p2p(
221+
pub(crate) async fn _recv_variable_p2p(
222222
&self,
223223
key: &str,
224224
sender: &Participant,

src/extensions/variable_transfer/remote_storage.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,16 @@ impl crate::application::CoLink {
6060
Ok(())
6161
}
6262

63-
#[deprecated(note = "please use `receive_variable_with_remote_storage` instead")]
63+
#[deprecated(note = "please use `recv_variable_with_remote_storage` instead")]
6464
pub async fn get_variable_with_remote_storage(
6565
&self,
6666
key: &str,
6767
sender: &Participant,
6868
) -> Result<Vec<u8>, Error> {
69-
self.receive_variable_with_remote_storage(key, sender).await
69+
self.recv_variable_with_remote_storage(key, sender).await
7070
}
7171

72-
pub async fn receive_variable_with_remote_storage(
72+
pub async fn recv_variable_with_remote_storage(
7373
&self,
7474
key: &str,
7575
sender: &Participant,

tests/test_protocol_variable_transfer.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ impl ProtocolEntry for Receiver {
4040
for i in 0..8 {
4141
let key = &format!("output{}", i);
4242
let key2 = &format!("output_remote_storage{}", i);
43-
let msg = cl.receive_variable(key, &participants[0]).await?;
43+
let msg = cl.recv_variable(key, &participants[0]).await?;
4444
cl.create_entry(&format!("tasks:{}:output{}", cl.get_task_id()?, i), &msg)
4545
.await?;
4646
let msg = cl
47-
.receive_variable_with_remote_storage(key2, &participants[0])
47+
.recv_variable_with_remote_storage(key2, &participants[0])
4848
.await?;
4949
cl.create_entry(
5050
&format!("tasks:{}:output_remote_storage{}", cl.get_task_id()?, i),

0 commit comments

Comments
 (0)