fixed-messaging-and-basic-probes

This commit is contained in:
voidlizard 2024-10-25 16:53:11 +03:00
parent 82b3106ca6
commit 2c8ef85980
1 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,24 @@
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE UndecidableInstances #-}
module RPC2.Probes where
import HBS2.Prelude.Plated
import HBS2.Net.Proto.Service
import HBS2.System.Logger.Simple
import HBS2.Peer.RPC.API.Peer
import HBS2.Peer.RPC.Internal.Types
import UnliftIO
instance (MonadIO m, HasRpcContext PeerAPI RPC2Context m) => HandleMethod m RpcGetProbes where
handleMethod _ = do
probes <- getRpcContext @PeerAPI
<&> rpcProbes
>>= readTVarIO
debug $ "rpc.getProbes"
probeSnapshot probes