Skip to content

Commit ae3ffa0

Browse files
committed
gw: hoist mpsc paths to use clauses in main_service
1 parent e8aef63 commit ae3ffa0

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

gateway/src/main_service.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ use rinja::Template as _;
2828
use safe_write::safe_write;
2929
use serde::{Deserialize, Serialize};
3030
use smallvec::{smallvec, SmallVec};
31-
use tokio::sync::Notify;
31+
use tokio::sync::{
32+
mpsc::{unbounded_channel, UnboundedSender},
33+
Notify,
34+
};
3235
use tokio_rustls::TlsAcceptor;
3336
use tracing::{debug, error, info, warn};
3437

@@ -78,7 +81,7 @@ pub struct ProxyInner {
7881
/// Sender for the background port_attrs lazy-fetch worker. The proxy fast
7982
/// path enqueues unknown instance_ids and immediately returns `pp=false`
8083
/// so a missing cache never blocks a connection.
81-
pub(crate) port_attrs_tx: tokio::sync::mpsc::UnboundedSender<String>,
84+
pub(crate) port_attrs_tx: UnboundedSender<String>,
8285
}
8386

8487
#[derive(Debug, Serialize, Deserialize, Default)]
@@ -107,7 +110,7 @@ pub struct ProxyOptions {
107110

108111
impl Proxy {
109112
pub async fn new(options: ProxyOptions) -> Result<Self> {
110-
let (port_attrs_tx, port_attrs_rx) = tokio::sync::mpsc::unbounded_channel();
113+
let (port_attrs_tx, port_attrs_rx) = unbounded_channel();
111114
let inner = ProxyInner::new(options, port_attrs_tx).await?;
112115
let proxy = Self {
113116
_inner: Arc::new(inner),
@@ -124,7 +127,7 @@ impl ProxyInner {
124127

125128
pub async fn new(
126129
options: ProxyOptions,
127-
port_attrs_tx: tokio::sync::mpsc::UnboundedSender<String>,
130+
port_attrs_tx: UnboundedSender<String>,
128131
) -> Result<Self> {
129132
let ProxyOptions {
130133
config,

0 commit comments

Comments
 (0)