diff options
author | jim@bo <jim@bo> | 2018-06-21 05:55:32 -0400 |
---|---|---|
committer | jim@bo <jim@bo> | 2018-06-21 05:55:32 -0400 |
commit | 43aced9d6c73135a21c877a79e7e5c920cebe5bb (patch) | |
tree | fb49808fc3ce7fe898683d696585f30e1033e833 /src/Data | |
parent | 064aba3a5dcf255015dcd2d4da7d4811c22287c9 (diff) |
Packet request Thread, ready for testing
Diffstat (limited to 'src/Data')
-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 | ||