diff options
Diffstat (limited to 'src/Data/PacketQueue.hs')
-rw-r--r-- | src/Data/PacketQueue.hs | 4 |
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 @@ | |||
7 | module Data.PacketQueue | 7 | module 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 | ||
52 | getLastDequeuedPlus1 :: PacketQueue a -> STM Word32 | ||
53 | getLastDequeuedPlus1 PacketQueue {seqno} = readTVar seqno | ||
54 | |||
51 | getCapacity :: Applicative m => PacketQueue t -> m Word32 | 55 | getCapacity :: Applicative m => PacketQueue t -> m Word32 |
52 | getCapacity (PacketQueue { qsize }) = pure qsize | 56 | getCapacity (PacketQueue { qsize }) = pure qsize |
53 | 57 | ||