diff options
| author | hozan23 <hozan23@karyontech.net> | 2024-05-23 00:19:58 +0200 | 
|---|---|---|
| committer | hozan23 <hozan23@karyontech.net> | 2024-05-23 00:19:58 +0200 | 
| commit | 2d1a8aea0b9330cd2eaad26eb187644adad6bed9 (patch) | |
| tree | 6083adaa09ae2f0ef2912f7934cdf0bfafff1654 /jsonrpc/src/server/pubsub_service.rs | |
| parent | cc1d61c401e52ba3b6cd264c5400fb7ab52522dc (diff) | |
jsonrpc: spawn task when handle new request
Diffstat (limited to 'jsonrpc/src/server/pubsub_service.rs')
| -rw-r--r-- | jsonrpc/src/server/pubsub_service.rs | 6 | 
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, | 
