Skip to content

Commit

Permalink
ouroboros-network-framework: moved OuroborosApplication
Browse files Browse the repository at this point in the history
Also extend its haddocks.
  • Loading branch information
coot committed Jun 2, 2023
1 parent 7a87c90 commit 61479df
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions ouroboros-network-framework/src/Ouroboros/Network/Mux.hs
Expand Up @@ -72,15 +72,6 @@ import Ouroboros.Network.PeerSelection.LedgerPeers.Type (IsBigLedgerPe




-- | Like 'MuxApplication' but using a 'MuxPeer' rather than a raw
-- @Channel -> m a@ action.
--
newtype OuroborosApplication (mode :: MuxMode) addr bytes m a b =
OuroborosApplication
(ConnectionId addr -> ControlMessageSTM m -> [MiniProtocol mode bytes m a b])


-- | There are three kinds of applications: warm, hot and established (ones
-- that run in both warm and hot peers).
--
Expand Down Expand Up @@ -279,6 +270,16 @@ data MuxPeer bytes m a where
:: (Channel m bytes -> m (a, Maybe bytes))
-> MuxPeer bytes m a


-- | Like 'MuxApplication' but using a 'MuxPeer' rather than a raw
-- @Channel -> m a@ action.
--
-- Note: Only used in some non-P2P contexts.
newtype OuroborosApplication (mode :: MuxMode) addr bytes m a b =
OuroborosApplication
(ConnectionContext addr m -> [MiniProtocol mode bytes m a b])


-- | Create non p2p mux application.
--
-- Note that callbacks will always receive `IsNotBigLedgerPeer`.
Expand Down

0 comments on commit 61479df

Please sign in to comment.