aboutsummaryrefslogtreecommitdiff
path: root/jsonrpc/examples/tokio_server
diff options
context:
space:
mode:
Diffstat (limited to 'jsonrpc/examples/tokio_server')
-rw-r--r--jsonrpc/examples/tokio_server/Cargo.lock1
-rw-r--r--jsonrpc/examples/tokio_server/src/main.rs4
2 files changed, 4 insertions, 1 deletions
diff --git a/jsonrpc/examples/tokio_server/Cargo.lock b/jsonrpc/examples/tokio_server/Cargo.lock
index a7fdb0b..ab39fcd 100644
--- a/jsonrpc/examples/tokio_server/Cargo.lock
+++ b/jsonrpc/examples/tokio_server/Cargo.lock
@@ -681,6 +681,7 @@ dependencies = [
name = "karyon_jsonrpc"
version = "0.1.0"
dependencies = [
+ "async-channel",
"async-trait",
"async-tungstenite",
"karyon_core",
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");