aboutsummaryrefslogtreecommitdiff
path: root/crates/whirl_server/src/interaction
diff options
context:
space:
mode:
authorFuwn <[email protected]>2021-06-06 00:24:21 -0700
committerFuwn <[email protected]>2021-06-06 00:24:21 -0700
commit233104e6e37345c1d29f623208bc12651027ec37 (patch)
tree62418d42700f21a61279f624ab20172c2b6bc086 /crates/whirl_server/src/interaction
parentfix(whirl_server::hub): space between debug log message (diff)
downloadwhirl-233104e6e37345c1d29f623208bc12651027ec37.tar.xz
whirl-233104e6e37345c1d29f623208bc12651027ec37.zip
refactor(whirl_server): move orphan types out of orphan module
Diffstat (limited to 'crates/whirl_server/src/interaction')
-rw-r--r--crates/whirl_server/src/interaction/peer.rs4
-rw-r--r--crates/whirl_server/src/interaction/shared.rs4
2 files changed, 3 insertions, 5 deletions
diff --git a/crates/whirl_server/src/interaction/peer.rs b/crates/whirl_server/src/interaction/peer.rs
index 6a04b17..d7ac49e 100644
--- a/crates/whirl_server/src/interaction/peer.rs
+++ b/crates/whirl_server/src/interaction/peer.rs
@@ -9,11 +9,11 @@ use tokio::{
};
use tokio_util::codec::{BytesCodec, Framed};
-use crate::{interaction::shared::Shared, types::Rx};
+use crate::interaction::shared::Shared;
pub struct Peer {
pub bytes: Framed<TcpStream, BytesCodec>,
- pub rx: Rx,
+ pub rx: mpsc::UnboundedReceiver<bytes::BytesMut>,
}
impl Peer {
pub async fn new(
diff --git a/crates/whirl_server/src/interaction/shared.rs b/crates/whirl_server/src/interaction/shared.rs
index 7ad2510..91d7395 100644
--- a/crates/whirl_server/src/interaction/shared.rs
+++ b/crates/whirl_server/src/interaction/shared.rs
@@ -5,10 +5,8 @@ use std::collections::HashMap;
use bytes::BytesMut;
-use crate::types::Tx;
-
pub struct Shared {
- pub peers: HashMap<String, Tx>,
+ pub peers: HashMap<String, tokio::sync::mpsc::UnboundedSender<BytesMut>>,
}
impl Shared {
pub fn new() -> Self {