aboutsummaryrefslogtreecommitdiff
path: root/jsonrpc/src/server/pubsub_service.rs
diff options
context:
space:
mode:
Diffstat (limited to 'jsonrpc/src/server/pubsub_service.rs')
-rw-r--r--jsonrpc/src/server/pubsub_service.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/jsonrpc/src/server/pubsub_service.rs b/jsonrpc/src/server/pubsub_service.rs
index 5b4bf9a..5b3b50b 100644
--- a/jsonrpc/src/server/pubsub_service.rs
+++ b/jsonrpc/src/server/pubsub_service.rs
@@ -6,7 +6,7 @@ use super::channel::ArcChannel;
/// Represents the RPC method
pub type PubSubRPCMethod<'a> =
- Box<dyn Fn(ArcChannel, serde_json::Value) -> PubSubRPCMethodOutput<'a> + Send + 'a>;
+ Box<dyn Fn(ArcChannel, String, serde_json::Value) -> PubSubRPCMethodOutput<'a> + Send + 'a>;
type PubSubRPCMethodOutput<'a> =
Pin<Box<dyn Future<Output = Result<serde_json::Value>> + Send + Sync + 'a>>;
@@ -51,7 +51,9 @@ macro_rules! impl_pubsub_rpc_service {
match name {
$(
stringify!($m) => {
- Some(Box::new(move |chan: karyon_jsonrpc::ArcChannel, params: serde_json::Value| Box::pin(self.$m(chan, params))))
+ Some(Box::new(move |chan: karyon_jsonrpc::ArcChannel, method: String, params: serde_json::Value| {
+ Box::pin(self.$m(chan, method, params))
+ }))
}
)*
_ => None,