Skip to content

Commit

Permalink
update RPC examples to use buffered IO
Browse files Browse the repository at this point in the history
  • Loading branch information
dwrensha committed Jun 1, 2024
1 parent 453d58a commit 9a8b227
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions capnp-rpc/examples/calculator/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ async fn try_main(args: Vec<String>) -> Result<(), Box<dyn std::error::Error>> {
let (reader, writer) = tokio_util::compat::TokioAsyncReadCompatExt::compat(stream).split();

let network = Box::new(twoparty::VatNetwork::new(
reader,
writer,
futures::io::BufReader::new(reader),
futures::io::BufWriter::new(writer),
rpc_twoparty_capnp::Side::Client,
Default::default(),
));
Expand Down
4 changes: 2 additions & 2 deletions capnp-rpc/examples/calculator/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ pub async fn main() -> Result<(), Box<dyn std::error::Error>> {
let (reader, writer) =
tokio_util::compat::TokioAsyncReadCompatExt::compat(stream).split();
let network = twoparty::VatNetwork::new(
reader,
writer,
futures::io::BufReader::new(reader),
futures::io::BufWriter::new(writer),
rpc_twoparty_capnp::Side::Server,
Default::default(),
);
Expand Down
4 changes: 2 additions & 2 deletions capnp-rpc/examples/hello-world/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ pub async fn main() -> Result<(), Box<dyn std::error::Error>> {
let (reader, writer) =
tokio_util::compat::TokioAsyncReadCompatExt::compat(stream).split();
let rpc_network = Box::new(twoparty::VatNetwork::new(
reader,
writer,
futures::io::BufReader::new(reader),
futures::io::BufWriter::new(writer),
rpc_twoparty_capnp::Side::Client,
Default::default(),
));
Expand Down
4 changes: 2 additions & 2 deletions capnp-rpc/examples/hello-world/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ pub async fn main() -> Result<(), Box<dyn std::error::Error>> {
let (reader, writer) =
tokio_util::compat::TokioAsyncReadCompatExt::compat(stream).split();
let network = twoparty::VatNetwork::new(
reader,
writer,
futures::io::BufReader::new(reader),
futures::io::BufWriter::new(writer),
rpc_twoparty_capnp::Side::Server,
Default::default(),
);
Expand Down
4 changes: 2 additions & 2 deletions capnp-rpc/examples/pubsub/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ pub async fn main() -> Result<(), Box<dyn std::error::Error>> {
let (reader, writer) =
tokio_util::compat::TokioAsyncReadCompatExt::compat(stream).split();
let rpc_network = Box::new(twoparty::VatNetwork::new(
reader,
writer,
futures::io::BufReader::new(reader),
futures::io::BufWriter::new(writer),
rpc_twoparty_capnp::Side::Client,
Default::default(),
));
Expand Down
4 changes: 2 additions & 2 deletions capnp-rpc/examples/pubsub/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ pub async fn main() -> Result<(), Box<dyn std::error::Error>> {
let (reader, writer) =
tokio_util::compat::TokioAsyncReadCompatExt::compat(stream).split();
let network = twoparty::VatNetwork::new(
reader,
writer,
futures::io::BufReader::new(reader),
futures::io::BufWriter::new(writer),
rpc_twoparty_capnp::Side::Server,
Default::default(),
);
Expand Down

0 comments on commit 9a8b227

Please sign in to comment.