diff options
author | hozan23 <hozan23@karyontech.net> | 2024-05-21 02:20:45 +0200 |
---|---|---|
committer | hozan23 <hozan23@karyontech.net> | 2024-05-22 15:02:06 +0200 |
commit | 028940fe3e0a87cdc421a6d07f1ecfb6c208b9d0 (patch) | |
tree | 3272d5c71cafb098e548cb9811e8f9ddc260ef2f /jsonrpc/examples/tokio_server/src | |
parent | 0f0cefb62ee8b641dcabcc0a2a1cf019c1de4843 (diff) |
jsonrpc: support pubsub
Diffstat (limited to 'jsonrpc/examples/tokio_server/src')
-rw-r--r-- | jsonrpc/examples/tokio_server/src/main.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/jsonrpc/examples/tokio_server/src/main.rs b/jsonrpc/examples/tokio_server/src/main.rs index 978c90a..ce77cd3 100644 --- a/jsonrpc/examples/tokio_server/src/main.rs +++ b/jsonrpc/examples/tokio_server/src/main.rs @@ -1,3 +1,5 @@ +use std::sync::Arc; + use serde::{Deserialize, Serialize}; use serde_json::Value; @@ -48,7 +50,7 @@ async fn main() { // Creates a new server let server = Server::builder("tcp://127.0.0.1:6000") .expect("Create a new server builder") - .service(calc) + .service(Arc::new(calc)) .build() .await .expect("start a new server"); |