summaryrefslogtreecommitdiff
path: root/src/Data/PacketQueue.hs
diff options
context:
space:
mode:
authorJames Crayne <jim.crayne@gmail.com>2017-11-21 19:47:34 +0000
committerJames Crayne <jim.crayne@gmail.com>2017-11-21 19:48:01 +0000
commit2ff856624c60b6399407ad0dbc8a68ba2dcffab5 (patch)
tree82e9f99ea2ac48ba2105a1b01f34099eb57006d0 /src/Data/PacketQueue.hs
parenta1eaf77ad54e653539c83af8f2943de2b2db2578 (diff)
export readyOutGoing, for doing IO before enqueuing outgoing
Diffstat (limited to 'src/Data/PacketQueue.hs')
-rw-r--r--src/Data/PacketQueue.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Data/PacketQueue.hs b/src/Data/PacketQueue.hs
index 927d6c53..cde26fb7 100644
--- a/src/Data/PacketQueue.hs
+++ b/src/Data/PacketQueue.hs
@@ -134,6 +134,10 @@ newOutGoing inq towire toWireIO num capacity seqstart = do
134data OutGoingResult = OGSuccess | OGFull | OGEncodeFail 134data OutGoingResult = OGSuccess | OGFull | OGEncodeFail
135 deriving (Eq,Show) 135 deriving (Eq,Show)
136 136
137-- | do something in IO before appending to the queue
138readyOutGoing :: PacketOutQueue extra msg wire fromwire -> IO (STM extra)
139readyOutGoing (PacketOutQueue {pktoToWireIO }) = pktoToWireIO
140
137-- | Convert a message to packet format and append it to the front of a queue 141-- | Convert a message to packet format and append it to the front of a queue
138-- used for outgoing messages. (Note that ‘front‛ usually means the higher 142-- used for outgoing messages. (Note that ‘front‛ usually means the higher
139-- index in this implementation.) 143-- index in this implementation.)