diff options
author | gilles henaux <gill.henaux@gmail.com> | 2023-01-11 15:32:51 +0100 |
---|---|---|
committer | gilles henaux <gill.henaux@gmail.com> | 2023-01-11 15:32:51 +0100 |
commit | 47a272b0ce880a51a8f4502dc72a6ed0926f94a5 (patch) | |
tree | c9db4c2ec506001363eb3d8fa0328e1eb819b400 /src/shared/channel.rs | |
parent | 09890a11daeb3810dca5b3a30edede8a65a73257 (diff) |
[channels] Rename OrdRelChannelId to MultiChannelId and remove commented code
Diffstat (limited to 'src/shared/channel.rs')
-rw-r--r-- | src/shared/channel.rs | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/src/shared/channel.rs b/src/shared/channel.rs index 54ad3d7..5c458bb 100644 --- a/src/shared/channel.rs +++ b/src/shared/channel.rs @@ -10,7 +10,7 @@ use tokio::sync::{ }; use tokio_util::codec::{FramedWrite, LengthDelimitedCodec}; -pub(crate) type OrdRelChannelId = u64; +pub(crate) type MultiChannelId = u64; #[derive(Debug, Copy, Clone)] pub enum ChannelType { @@ -21,7 +21,7 @@ pub enum ChannelType { #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] pub enum ChannelId { - OrderedReliable(OrdRelChannelId), + OrderedReliable(MultiChannelId), UnorderedReliable, Unreliable, } @@ -132,24 +132,3 @@ async fn new_uni_frame_sender( .expect("Failed to open send stream"); FramedWrite::new(uni_sender, LengthDelimitedCodec::new()) } - -// async fn send_msg( -// // close_sender: &tokio::sync::broadcast::Sender<()>, -// to_sync_client: &mpsc::Sender<InternalAsyncMessage>, -// frame_send: &mut FramedWrite<SendStream, LengthDelimitedCodec>, -// msg_bytes: Bytes, -// ) { -// if let Err(err) = frame_send.send(msg_bytes).await { -// error!("Error while sending, {}", err); -// error!("Client seems disconnected, closing resources"); -// // Emit LostConnection to properly update the connection about its state. -// // Raise LostConnection event before emitting a close signal because we have no guarantee to continue this async execution after the close signal has been processed. -// to_sync_client -// .send(InternalAsyncMessage::LostConnection) -// .await -// .expect("Failed to signal connection lost to sync client"); -// // if let Err(_) = close_sender.send(()) { -// // error!("Failed to close all client streams & resources") -// // } -// } -// } |