Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- newtype LocalStateQueryClient block point (query ∷ Type → Type) m a = LocalStateQueryClient {
- runLocalStateQueryClient ∷ m (ClientStIdle block point query m a)
- data ClientStIdle block point query (m ∷ Type → Type) a where
- SendMsgAcquire ∷ Target point → ClientStAcquiring block point query m a → ClientStIdle block point query m a
- SendMsgDone ∷ a → ClientStIdle block point query m a
- data ClientStAcquiring block point query m a = ClientStAcquiring {
- recvMsgAcquired ∷ m (ClientStAcquired block point query m a)
- recvMsgFailure ∷ AcquireFailure → m (ClientStIdle block point query m a)
- data ClientStAcquired block point query m a where
- SendMsgQuery ∷ query result → ClientStQuerying block point query m a result → ClientStAcquired block point query m a
- SendMsgReAcquire ∷ Target point → ClientStAcquiring block point query m a → ClientStAcquired block point query m a
- SendMsgRelease ∷ m (ClientStIdle block point query m a) → ClientStAcquired block point query m a
- data ClientStQuerying block point query m a result = ClientStQuerying {
- recvMsgResult ∷ result → m (ClientStAcquired block point query m a)
- localStateQueryClientPeer ∷ ∀ block point (query ∷ Type → Type) m a. Monad m ⇒ LocalStateQueryClient block point query m a → Peer (LocalStateQuery block point query) AsClient StIdle m a
- localStateQueryClientNull ∷ MonadTimer m ⇒ LocalStateQueryClient block point query m a
- mapLocalStateQueryClient ∷ ∀ block block' point point' query query' m a. Functor m ⇒ (point → point') → (∀ result. query result → Some query') → (∀ result result'. query result → query' result' → result' → result) → LocalStateQueryClient block point query m a → LocalStateQueryClient block' point' query' m a
- data Some (f ∷ k → Type) where
Protocol type for the client
The protocol states from the point of view of the client.
newtype LocalStateQueryClient block point (query ∷ Type → Type) m a Source #
LocalStateQueryClient | |
|
data ClientStIdle block point query (m ∷ Type → Type) a where Source #
In the StIdle
protocol state, the client has agency and must send:
- a request to acquire a state
- a termination messge
SendMsgAcquire ∷ Target point → ClientStAcquiring block point query m a → ClientStIdle block point query m a | |
SendMsgDone ∷ a → ClientStIdle block point query m a |
data ClientStAcquiring block point query m a Source #
In the StAcquiring
protocol state, the client does not have agency.
Instead it is waiting for:
- acquired
- failure to acquire
It must be prepared to handle either.
ClientStAcquiring | |
|
data ClientStAcquired block point query m a where Source #
In the StAcquired
protocol state, the client has agency and must send:
- a query
- a request to (re)acquire another state
- a release of the current state
SendMsgQuery ∷ query result → ClientStQuerying block point query m a result → ClientStAcquired block point query m a | |
SendMsgReAcquire ∷ Target point → ClientStAcquiring block point query m a → ClientStAcquired block point query m a | |
SendMsgRelease ∷ m (ClientStIdle block point query m a) → ClientStAcquired block point query m a |
data ClientStQuerying block point query m a result Source #
In the StQuerying
protocol state, the client does not have agency.
Instead it is waiting for:
- a result
ClientStQuerying | |
|
Execution as a typed protocol
localStateQueryClientPeer ∷ ∀ block point (query ∷ Type → Type) m a. Monad m ⇒ LocalStateQueryClient block point query m a → Peer (LocalStateQuery block point query) AsClient StIdle m a Source #
Interpret a LocalStateQueryClient
action sequence as a Peer
on the
client side of the LocalStateQuery
protocol.
Null local state query client
localStateQueryClientNull ∷ MonadTimer m ⇒ LocalStateQueryClient block point query m a Source #
Deprecated: Use Ouroboros.Network.NodeToClient.localStateQueryPeerNull
Utilities
mapLocalStateQueryClient ∷ ∀ block block' point point' query query' m a. Functor m ⇒ (point → point') → (∀ result. query result → Some query') → (∀ result result'. query result → query' result' → result' → result) → LocalStateQueryClient block point query m a → LocalStateQueryClient block' point' query' m a Source #
Transform a LocalStateQueryClient
by mapping over the query and query
result values.
Note the direction of the individual mapping functions corresponds to whether the types are used as protocol inputs or outputs.