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 SubscriptionTracers a = SubscriptionTracers {}
- 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.7-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 #
Connection is identified by local and remote address.
TODO: the type variable which this data type fills in is called peerid
. We
should renamed to connectionId
.
Constructors
ConnectionId | |
Fields
|
Instances
newtype LocalAddress #
Local address, on Unix is associated with AF_UNIX
family, on
Windows with `named-pipes`.
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-framework-0.17.0.0-inplace" '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 #
A callback executed by each muxed mini-protocol.
Constructors
MiniProtocolCb | |
Fields
|
data RunMiniProtocol (mode :: Mode) initiatorCtx responderCtx bytes (m :: Type -> Type) a b where #
RunMiniProtocol
. It also capture context (the IsBigLedgerPeer
) which
is passed to the mini-protocol when a mini-protocol is started.
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 #
Control signal sent to a mini-protocol. Expected to exit, on Continue
it
should continue its operation
Constructors
Continue | Continue operation. |
Quiesce | Hold on, e.g. do not sent messages until resumed. This is not used for any hot protocol. |
Terminate | The client is expected to terminate as soon as possible. |
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 # |