Skip to content

Commit a714a15

Browse files
committed
Merge main and fix up
1 parent 252c980 commit a714a15

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/transport/boxed.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -421,9 +421,9 @@ impl<S: Service> BoxableConnection<S::Res, S::Req> for super::tokio_mpsc::Connec
421421
Box::new(self.clone())
422422
}
423423

424-
fn open_bi_boxed(&self) -> OpenFuture<S::Res, S::Req> {
424+
fn open_boxed(&self) -> OpenFuture<S::Res, S::Req> {
425425
let f = Box::pin(async move {
426-
let (send, recv) = super::Connection::open_bi(self).await?;
426+
let (send, recv) = super::Connection::open(self).await?;
427427
// return the boxed streams
428428
anyhow::Ok((
429429
SendSink::direct_tokio(send.0),
@@ -442,7 +442,7 @@ impl<S: Service> BoxableServerEndpoint<S::Req, S::Res> for super::tokio_mpsc::Se
442442

443443
fn accept_bi_boxed(&self) -> AcceptFuture<S::Req, S::Res> {
444444
let f = async move {
445-
let (send, recv) = super::ServerEndpoint::accept_bi(self).await?;
445+
let (send, recv) = super::ServerEndpoint::accept(self).await?;
446446
let send = send.sink_map_err(anyhow::Error::from);
447447
let recv = recv.map_err(anyhow::Error::from);
448448
anyhow::Ok((SendSink::boxed(send), RecvStream::boxed(recv)))

src/transport/tokio_mpsc.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ impl<S: Service> ConnectionCommon<S::Req, S::Res> for ServerEndpoint<S> {
137137
}
138138

139139
impl<S: Service> transport::ServerEndpoint<S::Req, S::Res> for ServerEndpoint<S> {
140-
async fn accept_bi(&self) -> Result<(Self::SendSink, Self::RecvStream), AcceptBiError> {
140+
async fn accept(&self) -> Result<(Self::SendSink, Self::RecvStream), AcceptBiError> {
141141
let (send, recv) = self
142142
.stream
143143
.lock()
@@ -167,7 +167,7 @@ impl<S: Service> ConnectionCommon<S::Res, S::Req> for Connection<S> {
167167
}
168168

169169
impl<S: Service> transport::Connection<S::Res, S::Req> for Connection<S> {
170-
async fn open_bi(&self) -> result::Result<Socket<S::Res, S::Req>, self::OpenBiError> {
170+
async fn open(&self) -> result::Result<Socket<S::Res, S::Req>, self::OpenBiError> {
171171
let (local_send, remote_recv) = mpsc::channel::<S::Req>(128);
172172
let (remote_send, local_recv) = mpsc::channel::<S::Res>(128);
173173
let remote_chan = (

tests/tokio_mpsc.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use quic_rpc::{
99
};
1010

1111
#[tokio::test]
12-
async fn async_channel_channel_bench() -> anyhow::Result<()> {
12+
async fn tokio_mpsc_channel_bench() -> anyhow::Result<()> {
1313
tracing_subscriber::fmt::try_init().ok();
1414
let (server, client) = tokio_mpsc::connection::<ComputeService>(1);
1515

@@ -26,7 +26,7 @@ async fn async_channel_channel_bench() -> anyhow::Result<()> {
2626
}
2727

2828
#[tokio::test]
29-
async fn async_channel_channel_mapped_bench() -> anyhow::Result<()> {
29+
async fn tokio_mpsc_channel_mapped_bench() -> anyhow::Result<()> {
3030
use derive_more::{From, TryInto};
3131
use serde::{Deserialize, Serialize};
3232

@@ -67,7 +67,7 @@ async fn async_channel_channel_mapped_bench() -> anyhow::Result<()> {
6767
tokio::task::spawn(async move {
6868
let service = ComputeService;
6969
loop {
70-
let (req, chan) = server.accept().await?;
70+
let (req, chan) = server.accept().await?.read_first().await?;
7171
let service = service.clone();
7272
tokio::spawn(async move {
7373
let req: OuterRequest = req;

0 commit comments

Comments
 (0)