| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Cardano.Client.Subscription
Synopsis
- subscribe :: LocalSnocket -> NetworkMagic -> Map NodeToClientVersion blockVersion -> SubscriptionTracers a -> SubscriptionParams a -> (NodeToClientVersion -> blockVersion -> NodeToClientProtocols 'InitiatorMode LocalAddress ByteString IO a Void) -> IO ()
- data SubscriptionParams a = SubscriptionParams {
- spAddress :: !LocalAddress
- spReconnectionDelay :: !(Maybe DiffTime)
- spCompleteCb :: Either SomeException a -> Decision
- data Decision
- data SubscriptionTracers a = SubscriptionTracers {
- stMuxTracer :: Tracer IO (WithBearer (ConnectionId LocalAddress) Trace)
- stMuxChannelTracer :: Tracer IO (WithBearer (ConnectionId LocalAddress) ChannelTrace)
- stMuxBearerTracer :: Tracer IO (WithBearer (ConnectionId LocalAddress) BearerTrace)
- stHandshakeTracer :: Tracer IO (WithBearer (ConnectionId LocalAddress) (TraceSendRecv (Handshake NodeToClientVersion Term)))
- stSubscriptionTracer :: Tracer IO (SubscriptionTrace a)
- data SubscriptionTrace a
- type MuxMode = Mode
- type MuxTrace = Trace
- data WithBearer peerid a
- data ConnectionId addr = ConnectionId {
- localAddress :: !addr
- remoteAddress :: !addr
- newtype LocalAddress = LocalAddress {}
- data NodeToClientProtocols (appType :: Mode) ntcAddr bytes (m :: Type -> Type) a b = NodeToClientProtocols {
- localChainSyncProtocol :: RunMiniProtocolWithMinimalCtx appType ntcAddr bytes m a b
- localTxSubmissionProtocol :: RunMiniProtocolWithMinimalCtx appType ntcAddr bytes m a b
- localStateQueryProtocol :: RunMiniProtocolWithMinimalCtx appType ntcAddr bytes m a b
- localTxMonitorProtocol :: RunMiniProtocolWithMinimalCtx appType ntcAddr bytes m a b
- newtype MiniProtocolCb ctx bytes (m :: Type -> Type) a = MiniProtocolCb {
- runMiniProtocolCb :: ctx -> Channel m bytes -> m (a, Maybe bytes)
- data RunMiniProtocol (mode :: Mode) initiatorCtx responderCtx bytes (m :: Type -> Type) a b where
- InitiatorProtocolOnly :: forall initiatorCtx bytes (m :: Type -> Type) a responderCtx. MiniProtocolCb initiatorCtx bytes m a -> RunMiniProtocol 'InitiatorMode initiatorCtx responderCtx bytes m a Void
- ResponderProtocolOnly :: forall responderCtx bytes (m :: Type -> Type) b initiatorCtx. MiniProtocolCb responderCtx bytes m b -> RunMiniProtocol 'ResponderMode initiatorCtx responderCtx bytes m Void b
- InitiatorAndResponderProtocol :: forall initiatorCtx bytes (m :: Type -> Type) a responderCtx b. MiniProtocolCb initiatorCtx bytes m a -> MiniProtocolCb responderCtx bytes m b -> RunMiniProtocol 'InitiatorResponderMode initiatorCtx responderCtx bytes m a b
- data ControlMessage
Subscription API
Arguments
| :: LocalSnocket | |
| -> NetworkMagic | |
| -> Map NodeToClientVersion blockVersion | Use |
| -> SubscriptionTracers a | |
| -> SubscriptionParams a | |
| -> (NodeToClientVersion -> blockVersion -> NodeToClientProtocols 'InitiatorMode LocalAddress ByteString IO a Void) | |
| -> IO () |
Subscribe using `node-to-client` mini-protocol.
blockVersion ought to be instantiated with `BlockNodeToClientVersion blk`.
The callback receives blockVersion associated with each
NodeToClientVersion and can be used to create codecs with
clientCodecs.
data SubscriptionParams a Source #
Constructors
| SubscriptionParams | |
Fields
| |
data SubscriptionTracers a Source #
Constructors
| SubscriptionTracers | |
Fields
| |
data SubscriptionTrace a Source #
Constructors
| SubscriptionResult a | |
| SubscriptionError SomeException | |
| SubscriptionReconnect | |
| SubscriptionTerminate |
Instances
| Show a => Show (SubscriptionTrace a) Source # | |
Defined in Cardano.Client.Subscription Methods showsPrec :: Int -> SubscriptionTrace a -> ShowS # show :: SubscriptionTrace a -> String # showList :: [SubscriptionTrace a] -> ShowS # | |
Re-exports
Mux
data WithBearer peerid a #
Type used for tracing mux events.
Instances
| Generic (WithBearer peerid a) | |||||
Defined in Network.Mux.Trace Associated Types
Methods from :: WithBearer peerid a -> Rep (WithBearer peerid a) x # to :: Rep (WithBearer peerid a) x -> WithBearer peerid a # | |||||
| (Show peerid, Show a) => Show (WithBearer peerid a) | |||||
Defined in Network.Mux.Trace Methods showsPrec :: Int -> WithBearer peerid a -> ShowS # show :: WithBearer peerid a -> String # showList :: [WithBearer peerid a] -> ShowS # | |||||
| type Rep (WithBearer peerid a) | |||||
Defined in Network.Mux.Trace type Rep (WithBearer peerid a) = D1 ('MetaData "WithBearer" "Network.Mux.Trace" "network-mux-0.9.1.0-inplace" 'False) (C1 ('MetaCons "WithBearer" 'PrefixI 'True) (S1 ('MetaSel ('Just "wbPeerId") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 peerid) :*: S1 ('MetaSel ('Just "wbEvent") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 a))) | |||||
Connections
data ConnectionId addr #
Constructors
| ConnectionId | |
Fields
| |
Instances
newtype LocalAddress #
Constructors
| LocalAddress | |
Fields | |
Instances
| Generic LocalAddress | |||||
Defined in Ouroboros.Network.Snocket Associated Types
| |||||
| Show LocalAddress | |||||
Defined in Ouroboros.Network.Snocket Methods showsPrec :: Int -> LocalAddress -> ShowS # show :: LocalAddress -> String # showList :: [LocalAddress] -> ShowS # | |||||
| Eq LocalAddress | |||||
Defined in Ouroboros.Network.Snocket | |||||
| Ord LocalAddress | |||||
Defined in Ouroboros.Network.Snocket Methods compare :: LocalAddress -> LocalAddress -> Ordering # (<) :: LocalAddress -> LocalAddress -> Bool # (<=) :: LocalAddress -> LocalAddress -> Bool # (>) :: LocalAddress -> LocalAddress -> Bool # (>=) :: LocalAddress -> LocalAddress -> Bool # max :: LocalAddress -> LocalAddress -> LocalAddress # min :: LocalAddress -> LocalAddress -> LocalAddress # | |||||
| Hashable LocalAddress | |||||
Defined in Ouroboros.Network.Snocket | |||||
| type Rep LocalAddress | |||||
Defined in Ouroboros.Network.Snocket type Rep LocalAddress = D1 ('MetaData "LocalAddress" "Ouroboros.Network.Snocket" "ouroboros-network-0.23.0.0-inplace-framework" 'True) (C1 ('MetaCons "LocalAddress" 'PrefixI 'True) (S1 ('MetaSel ('Just "getFilePath") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath))) | |||||
Protocol API
data NodeToClientProtocols (appType :: Mode) ntcAddr bytes (m :: Type -> Type) a b #
Record of node-to-client mini protocols.
Constructors
| NodeToClientProtocols | |
Fields
| |
newtype MiniProtocolCb ctx bytes (m :: Type -> Type) a #
Constructors
| MiniProtocolCb | |
Fields
| |
data RunMiniProtocol (mode :: Mode) initiatorCtx responderCtx bytes (m :: Type -> Type) a b where #
Constructors
| InitiatorProtocolOnly :: forall initiatorCtx bytes (m :: Type -> Type) a responderCtx. MiniProtocolCb initiatorCtx bytes m a -> RunMiniProtocol 'InitiatorMode initiatorCtx responderCtx bytes m a Void | |
| ResponderProtocolOnly :: forall responderCtx bytes (m :: Type -> Type) b initiatorCtx. MiniProtocolCb responderCtx bytes m b -> RunMiniProtocol 'ResponderMode initiatorCtx responderCtx bytes m Void b | |
| InitiatorAndResponderProtocol :: forall initiatorCtx bytes (m :: Type -> Type) a responderCtx b. MiniProtocolCb initiatorCtx bytes m a -> MiniProtocolCb responderCtx bytes m b -> RunMiniProtocol 'InitiatorResponderMode initiatorCtx responderCtx bytes m a b |
data ControlMessage #
Instances
| Show ControlMessage | |
Defined in Ouroboros.Network.ControlMessage Methods showsPrec :: Int -> ControlMessage -> ShowS # show :: ControlMessage -> String # showList :: [ControlMessage] -> ShowS # | |
| Eq ControlMessage | |
Defined in Ouroboros.Network.ControlMessage Methods (==) :: ControlMessage -> ControlMessage -> Bool # (/=) :: ControlMessage -> ControlMessage -> Bool # | |