Skip to content

Commit

Permalink
fix(iroh): use tokio transport for quic rpc
Browse files Browse the repository at this point in the history
  • Loading branch information
dignifiedquire committed Jun 25, 2024
1 parent 38e8ce0 commit e8ab34c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,6 @@ missing_debug_implementations = "warn"

[workspace.lints.clippy]
unused-async = "warn"

[patch.crates-io]
quic-rpc = { git = "https://github.com/n0-computer/quic-rpc", branch = "feat-async-channel" }
2 changes: 1 addition & 1 deletion iroh/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ iroh-docs = { version = "0.18.0", path = "../iroh-docs" }
iroh-gossip = { version = "0.18.0", path = "../iroh-gossip" }
parking_lot = "0.12.1"
postcard = { version = "1", default-features = false, features = ["alloc", "use-std", "experimental-derive"] }
quic-rpc = { version = "0.10.2", default-features = false, features = ["flume-transport", "quinn-transport"] }
quic-rpc = { version = "0.10.2", default-features = false, features = ["flume-transport", "tokio-mpsc-transport", "quinn-transport"] }
quinn = { package = "iroh-quinn", version = "0.10" }
rand = "0.8"
serde = { version = "1", features = ["derive"] }
Expand Down
6 changes: 3 additions & 3 deletions iroh/src/node/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use iroh_net::{
};
use quic_rpc::{
transport::{
flume::FlumeServerEndpoint, misc::DummyServerEndpoint, quinn::QuinnServerEndpoint,
misc::DummyServerEndpoint, quinn::QuinnServerEndpoint, tokio_mpsc::ServerEndpoint,
},
ServiceEndpoint,
};
Expand Down Expand Up @@ -494,7 +494,7 @@ where
.await?;

// Initialize the internal RPC connection.
let (internal_rpc, controller) = quic_rpc::transport::flume::connection(1);
let (internal_rpc, controller) = quic_rpc::transport::tokio_mpsc::connection(1);
// box the controller. Boxing has a special case for the flume channel that avoids allocations,
// so this has zero overhead.
let controller = quic_rpc::transport::boxed::Connection::new(controller);
Expand Down Expand Up @@ -538,7 +538,7 @@ where
#[derive(derive_more::Debug)]
pub struct ProtocolBuilder<D, E> {
inner: Arc<NodeInner<D>>,
internal_rpc: FlumeServerEndpoint<RpcService>,
internal_rpc: ServerEndpoint<RpcService>,
external_rpc: E,
protocols: ProtocolMap,
#[debug("callback")]
Expand Down

0 comments on commit e8ab34c

Please sign in to comment.