From 77910242ed8934d0bee43d014c317de7aee928a7 Mon Sep 17 00:00:00 2001 From: Nazar Mokrynskyi Date: Mon, 21 Sep 2020 21:43:17 +0300 Subject: [PATCH 1/3] Fix typos --- pubsub/examples/pubsub.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pubsub/examples/pubsub.rs b/pubsub/examples/pubsub.rs index b44896afa..50f8e4d25 100644 --- a/pubsub/examples/pubsub.rs +++ b/pubsub/examples/pubsub.rs @@ -39,7 +39,7 @@ fn main() { // or drop(subscriber) loop { - if is_done.load(atomic::Ordering::AcqRel) { + if is_done.load(atomic::Ordering::SeqCst) { return; } @@ -56,13 +56,13 @@ fn main() { }), ("remove_hello", move |_id: SubscriptionId, _| { println!("Closing subscription"); - is_done2.store(true, atomic::Ordering::AcqRel); + is_done2.store(true, atomic::Ordering::SeqCst); futures::future::ok(Value::Bool(true)) }), ); let server = ServerBuilder::new(io) - .session_meta_extractor(|context: &RequestContext| Some(Arc::new(Session::new(context.sender.clone())))) + .session_meta_extractor(|context: &RequestContext| Some(Arc::new(Session::new(context.sender())))) .start(&"127.0.0.1:3030".parse().unwrap()) .expect("Unable to start RPC server"); From b61e68229139dbc5866aa8c161c31b37df701f01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Drwi=C4=99ga?= Date: Wed, 23 Sep 2020 12:48:54 +0200 Subject: [PATCH 2/3] Fix request.sender --- pubsub/examples/pubsub.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pubsub/examples/pubsub.rs b/pubsub/examples/pubsub.rs index 50f8e4d25..c9b67e54e 100644 --- a/pubsub/examples/pubsub.rs +++ b/pubsub/examples/pubsub.rs @@ -62,7 +62,9 @@ fn main() { ); let server = ServerBuilder::new(io) - .session_meta_extractor(|context: &RequestContext| Some(Arc::new(Session::new(context.sender())))) + .session_meta_extractor(|context: &RequestContext| { + Some(Arc::new(Session::new(context.sender.clone()))) + }) .start(&"127.0.0.1:3030".parse().unwrap()) .expect("Unable to start RPC server"); From 990ac522a54ed4045254948dfdcb56e5a38081b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Drwi=C4=99ga?= Date: Wed, 23 Sep 2020 15:27:18 +0200 Subject: [PATCH 3/3] cargo fmt --all --- pubsub/examples/pubsub.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pubsub/examples/pubsub.rs b/pubsub/examples/pubsub.rs index c9b67e54e..60d17cde6 100644 --- a/pubsub/examples/pubsub.rs +++ b/pubsub/examples/pubsub.rs @@ -62,9 +62,7 @@ fn main() { ); let server = ServerBuilder::new(io) - .session_meta_extractor(|context: &RequestContext| { - Some(Arc::new(Session::new(context.sender.clone()))) - }) + .session_meta_extractor(|context: &RequestContext| Some(Arc::new(Session::new(context.sender.clone())))) .start(&"127.0.0.1:3030".parse().unwrap()) .expect("Unable to start RPC server");