Skip to content

Commit 1d76ce1

Browse files
committed
update hello-world rpc example to use tokio 0.3.0
1 parent 9c2a11b commit 1d76ce1

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

capnp-rpc/examples/hello-world/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ capnpc = { path = "../../../capnpc" }
1717
[dependencies]
1818
capnp = { path = "../../../capnp" }
1919
futures = "0.3.0"
20-
tokio = { version = "0.2.0", features = ["net", "rt-util", "tcp", "macros"]}
21-
tokio-util = { version = "0.3.0", features = ["compat"] }
20+
tokio = { version = "0.3.0", features = ["net", "rt", "macros"]}
21+
tokio-util = { version = "0.4.0", features = ["compat"] }
2222

2323
[dependencies.capnp-rpc]
2424
path = "../.."

capnp-rpc/examples/hello-world/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub mod hello_world_capnp {
2828
pub mod client;
2929
pub mod server;
3030

31-
#[tokio::main]
31+
#[tokio::main(flavor = "current_thread")]
3232
async fn main() -> Result<(), Box<dyn std::error::Error>> {
3333
let args: Vec<String> = ::std::env::args().collect();
3434
if args.len() >= 2 {

capnp-rpc/examples/hello-world/server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ pub async fn main() -> Result<(), Box<dyn std::error::Error>> {
6060
.expect("could not parse address");
6161

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

6666
loop {

0 commit comments

Comments
 (0)