diff options
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"); |