ouroboros-network-protocols-0.8.1.0: Ouroboros Network Protocols
Safe HaskellSafe-Inferred
LanguageHaskell2010

Ouroboros.Network.Protocol.LocalStateQuery.Server

Synopsis

Protocol type for the server

The protocol states from the point of view of the server.

newtype LocalStateQueryServer block point (query ∷ TypeType) m a Source #

Constructors

LocalStateQueryServer 

Fields

data ServerStIdle block point query m a Source #

In the StIdle protocol state, the server does not have agency. Instead it is waiting for:

  • a request to acquire a state
  • a termination messge

It must be prepared to handle either.

Constructors

ServerStIdle 

Fields

data ServerStAcquiring block point query m a where Source #

In the StAcquiring protocol state, the server has agency and must send either:

  • acquired
  • failure to acquire

Constructors

SendMsgAcquiredServerStAcquired block point query m a → ServerStAcquiring block point query m a 
SendMsgFailureAcquireFailureServerStIdle block point query m a → ServerStAcquiring block point query m a 

data ServerStAcquired block point query m a Source #

In the StAcquired protocol state, the server does not have agency. Instead it is waiting for:

  • a query
  • a request to (re)acquire another state
  • a release of the current state

It must be prepared to handle either.

Constructors

ServerStAcquired 

Fields

data ServerStQuerying block point query m a result where Source #

In the StQuerying protocol state, the server has agency and must send:

  • a result

Constructors

SendMsgResult ∷ result → ServerStAcquired block point query m a → ServerStQuerying block point query m a result 

Execution as a typed protocol

localStateQueryServerPeer ∷ ∀ block point (query ∷ TypeType) m a. Monad m ⇒ LocalStateQueryServer block point query m a → Peer (LocalStateQuery block point query) AsServer StIdle m a Source #

Interpret a LocalStateQueryServer action sequence as a Peer on the server side of the LocalStateQuery protocol.