summaryrefslogtreecommitdiff
path: root/src/Data/PacketQueue.hs
diff options
context:
space:
mode:
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 23db0ee0..560e7382 100644
--- a/src/Data/PacketQueue.hs
+++ b/src/Data/PacketQueue.hs
@@ -7,6 +7,7 @@
7module Data.PacketQueue 7module Data.PacketQueue
8 ( PacketQueue 8 ( PacketQueue
9 , getCapacity 9 , getCapacity
10 , getLastDequeuedPlus1
10 , new 11 , new
11 , dequeue 12 , dequeue
12 , getMissing 13 , getMissing
@@ -48,6 +49,9 @@ packetQueueViewList p = do
48 f (n,Just x) = Just (n,x) 49 f (n,Just x) = Just (n,x)
49 catMaybes . map f <$> getAssocs (pktq p) 50 catMaybes . map f <$> getAssocs (pktq p)
50 51
52getLastDequeuedPlus1 :: PacketQueue a -> STM Word32
53getLastDequeuedPlus1 PacketQueue {seqno} = readTVar seqno
54
51getCapacity :: Applicative m => PacketQueue t -> m Word32 55getCapacity :: Applicative m => PacketQueue t -> m Word32
52getCapacity (PacketQueue { qsize }) = pure qsize 56getCapacity (PacketQueue { qsize }) = pure qsize
53 57