From 45af6ccdeb631aee74d1472d4216cf5cdf652a2f Mon Sep 17 00:00:00 2001 From: Tim Kuehn Date: Sat, 7 Dec 2019 22:01:37 -0800 Subject: [PATCH] Workaround for pubsub example hanging. The publisher client isn't being dropped when the async fn returns. It could potentially be something strange in the ThreadPool executor. --- tarpc/examples/pubsub.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/tarpc/examples/pubsub.rs b/tarpc/examples/pubsub.rs index f20e164..70f2a8d 100644 --- a/tarpc/examples/pubsub.rs +++ b/tarpc/examples/pubsub.rs @@ -186,6 +186,7 @@ async fn main() -> io::Result<()> { publisher .broadcast(context::current(), "hi again".to_string()) .await?; + drop(publisher); tokio::time::delay_for(Duration::from_millis(100)).await; println!("Done.");