Skip to content

Commit

Permalink
update hello-world rpc example to use tokio 0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dwrensha committed Oct 17, 2020
1 parent 9c2a11b commit 1d76ce1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions capnp-rpc/examples/hello-world/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ capnpc = { path = "../../../capnpc" }
[dependencies]
capnp = { path = "../../../capnp" }
futures = "0.3.0"
tokio = { version = "0.2.0", features = ["net", "rt-util", "tcp", "macros"]}
tokio-util = { version = "0.3.0", features = ["compat"] }
tokio = { version = "0.3.0", features = ["net", "rt", "macros"]}
tokio-util = { version = "0.4.0", features = ["compat"] }

[dependencies.capnp-rpc]
path = "../.."
2 changes: 1 addition & 1 deletion capnp-rpc/examples/hello-world/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub mod hello_world_capnp {
pub mod client;
pub mod server;

#[tokio::main]
#[tokio::main(flavor = "current_thread")]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let args: Vec<String> = ::std::env::args().collect();
if args.len() >= 2 {
Expand Down
2 changes: 1 addition & 1 deletion capnp-rpc/examples/hello-world/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ pub async fn main() -> Result<(), Box<dyn std::error::Error>> {
.expect("could not parse address");

tokio::task::LocalSet::new().run_until(async move {
let mut listener = tokio::net::TcpListener::bind(&addr).await?;
let listener = tokio::net::TcpListener::bind(&addr).await?;
let hello_world_client: hello_world::Client = capnp_rpc::new_client(HelloWorldImpl);

loop {
Expand Down

0 comments on commit 1d76ce1

Please sign in to comment.