Skip to content

Commit a0bf5bb

Browse files
committed
update calculator rpc example to use tokio 0.3.0
1 parent 1d76ce1 commit a0bf5bb

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

capnp-rpc/examples/calculator/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/calculator/main.rs

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

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

capnp-rpc/examples/calculator/server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ pub async fn main() -> Result<(), Box<dyn std::error::Error>> {
203203
let addr = args[2].to_socket_addrs().unwrap().next().expect("could not parse address");
204204

205205
tokio::task::LocalSet::new().run_until(async move {
206-
let mut listener = tokio::net::TcpListener::bind(&addr).await?;
206+
let listener = tokio::net::TcpListener::bind(&addr).await?;
207207
let calc: calculator::Client = capnp_rpc::new_client(CalculatorImpl);
208208

209209
loop {

0 commit comments

Comments
 (0)