Skip to content

Commit fb230d4

Browse files
committed
update pubsub example to use tokio 0.3.0
1 parent a0bf5bb commit fb230d4

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

capnp-rpc/examples/pubsub/Cargo.toml

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

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

capnp-rpc/examples/pubsub/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub mod pubsub_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/pubsub/server.rs

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

114114
tokio::task::LocalSet::new().run_until(async move {
115-
let mut listener = tokio::net::TcpListener::bind(&addr).await?;
115+
let listener = tokio::net::TcpListener::bind(&addr).await?;
116116
let (publisher_impl, subscribers) = PublisherImpl::new();
117117
let publisher: publisher::Client<_> = capnp_rpc::new_client(publisher_impl);
118118

0 commit comments

Comments
 (0)