From 2ff856624c60b6399407ad0dbc8a68ba2dcffab5 Mon Sep 17 00:00:00 2001 From: James Crayne Date: Tue, 21 Nov 2017 19:47:34 +0000 Subject: export readyOutGoing, for doing IO before enqueuing outgoing --- src/Data/PacketQueue.hs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') 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 data OutGoingResult = OGSuccess | OGFull | OGEncodeFail deriving (Eq,Show) +-- | do something in IO before appending to the queue +readyOutGoing :: PacketOutQueue extra msg wire fromwire -> IO (STM extra) +readyOutGoing (PacketOutQueue {pktoToWireIO }) = pktoToWireIO + -- | Convert a message to packet format and append it to the front of a queue -- used for outgoing messages. (Note that ‘front‛ usually means the higher -- index in this implementation.) -- cgit v1.2.3