diff options
author | Alex Auvolat <alex@adnab.me> | 2022-07-26 12:11:48 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2022-07-26 12:11:48 +0200 |
commit | b55f61c38b01da01314d99ced543aba713dbd2a9 (patch) | |
tree | 401e95bbb9db8e0454dc31f1af01ef41139c87c8 /examples/fullmesh.rs | |
parent | bdf7d4731dcd2e9b523758272fdc41b374044a9f (diff) | |
download | netapp-b55f61c38b01da01314d99ced543aba713dbd2a9.tar.gz netapp-b55f61c38b01da01314d99ced543aba713dbd2a9.zip |
Fix things going wrong when sending chan is closed
Diffstat (limited to 'examples/fullmesh.rs')
-rw-r--r-- | examples/fullmesh.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/fullmesh.rs b/examples/fullmesh.rs index 82e45c3..972bec0 100644 --- a/examples/fullmesh.rs +++ b/examples/fullmesh.rs @@ -125,7 +125,7 @@ impl Example { async fn exchange_loop(self: Arc<Self>, must_exit: watch::Receiver<bool>) { let mut i = 12000; while !*must_exit.borrow() { - tokio::time::sleep(Duration::from_secs(7)).await; + tokio::time::sleep(Duration::from_secs(2)).await; let peers = self.fullmesh.get_peer_list(); for p in peers.iter() { @@ -144,7 +144,7 @@ impl Example { ); let stream = Box::pin(stream::iter([100, 200, 300, 400]).then(|x| async move { - tokio::time::sleep(Duration::from_millis(100)).await; + tokio::time::sleep(Duration::from_millis(500)).await; Ok(Bytes::from(vec![(x % 256) as u8; 133 * x])) })); match self2 @@ -196,7 +196,7 @@ impl StreamingEndpointHandler<ExampleMessage> for Example { "Handler: stream got bytes {:?}", x.as_ref().map(|b| b.len()) ); - tokio::time::sleep(Duration::from_millis(100)).await; + tokio::time::sleep(Duration::from_millis(300)).await; Ok(Bytes::from(vec![ 10u8; x.map(|b| b.len()).unwrap_or(1422) * 2 |