Skip to content

Commit bea3a25

Browse files
committed
rename
1 parent 4796f4e commit bea3a25

File tree

6 files changed

+14
-20
lines changed

6 files changed

+14
-20
lines changed

volo-thrift/src/transport/incoming.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,3 @@ impl Stream for Incoming {
3030
}
3131
}
3232
}
33-
34-
#[cfg(test)]
35-
mod tests {
36-
#[test]
37-
fn test() {}
38-
}

volo-thrift/src/transport/multiplex/client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ where
157157
}
158158
}
159159
if cx.transport.should_reuse && resp.is_ok() {
160-
if let Transport::Pooled(pooled) = transport {
160+
if let Transport::TcpOrUnix(pooled) = transport {
161161
pooled.reuse().await;
162162
}
163163
}

volo-thrift/src/transport/pingpong/client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ where
131131
.call((target, shmipc_target.clone(), Ver::PingPong))
132132
.await?;
133133
cx.stats.record_make_transport_end_at();
134-
if let Transport::UnPooled(_) = transport {
134+
if let Transport::Shm(_) = transport {
135135
cx.rpc_info
136136
.caller_mut()
137137
.set_transport(volo::net::shm::Transport(FastStr::new("shmipc")))

volo-thrift/src/transport/pingpong/server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ pub async fn serve<Svc, Req, Resp, E, D, SP>(
6060
cx.rpc_info.caller_mut().set_address(peer_addr.clone());
6161
} else {
6262
cx.rpc_info
63-
.caller_mut()
63+
.callee_mut()
6464
.set_transport(volo::net::shm::Transport(FastStr::new("shmipc")));
6565
cx.rpc_info
6666
.caller_mut()

volo-thrift/src/transport/pool/make_transport.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ where
5656
let mt = self.inner.clone();
5757
if let Some(addr) = kv.1 {
5858
if let Ok(resp) = mt.call(addr.clone()).await {
59-
return Ok(Transport::UnPooled(resp));
59+
return Ok(Transport::Shm(resp));
6060
}
6161
}
6262
self.pool

volo-thrift/src/transport/pool/mod.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -416,17 +416,17 @@ struct Idle<T> {
416416
}
417417

418418
pub enum Transport<K: Key, T: Poolable> {
419-
Pooled(Pooled<K, T>),
420-
UnPooled(T),
419+
TcpOrUnix(Pooled<K, T>),
420+
Shm(T),
421421
}
422422

423423
impl<E: Encoder, D: Decoder> Transport<Address, ThriftTransport<E, D>> {
424424
pub async fn reuse(self) {
425425
match self {
426-
Transport::Pooled(pooled) => {
426+
Transport::TcpOrUnix(pooled) => {
427427
pooled.reuse().await;
428428
}
429-
Transport::UnPooled(t) => {
429+
Transport::Shm(t) => {
430430
t.reuse().await;
431431
}
432432
}
@@ -435,30 +435,30 @@ impl<E: Encoder, D: Decoder> Transport<Address, ThriftTransport<E, D>> {
435435

436436
impl<K: Key, T: Poolable> From<Pooled<K, T>> for Transport<K, T> {
437437
fn from(pooled: Pooled<K, T>) -> Self {
438-
Transport::Pooled(pooled)
438+
Transport::TcpOrUnix(pooled)
439439
}
440440
}
441441

442442
impl<K: Key, T: Poolable> From<T> for Transport<K, T> {
443443
fn from(t: T) -> Self {
444-
Transport::UnPooled(t)
444+
Transport::Shm(t)
445445
}
446446
}
447447

448448
impl<K: Key, T: Poolable> AsRef<T> for Transport<K, T> {
449449
fn as_ref(&self) -> &T {
450450
match self {
451-
Transport::Pooled(pooled) => pooled.t.as_ref().expect("not dropped"),
452-
Transport::UnPooled(t) => t,
451+
Transport::TcpOrUnix(pooled) => pooled.t.as_ref().expect("not dropped"),
452+
Transport::Shm(t) => t,
453453
}
454454
}
455455
}
456456

457457
impl<K: Key, T: Poolable> AsMut<T> for Transport<K, T> {
458458
fn as_mut(&mut self) -> &mut T {
459459
match self {
460-
Transport::Pooled(pooled) => pooled.t.as_mut().expect("not dropped"),
461-
Transport::UnPooled(t) => t,
460+
Transport::TcpOrUnix(pooled) => pooled.t.as_mut().expect("not dropped"),
461+
Transport::Shm(t) => t,
462462
}
463463
}
464464
}

0 commit comments

Comments
 (0)