Safe Haskell | None |
---|---|
Language | Haskell2010 |
- reorderFramesBySeqNumC :: (Default s, Default i, Default t, Default p, Num s, Ord s, Monad m) => Int -> Conduit (Stream i s t p c) m (Stream i s t p c)
- reorderFramesByC :: (Monad m, Ord rank, Default i, Default t, Default s, Default p, Default rank) => Lens' (Stream i s t p c) rank -> (rank -> rank) -> Int -> Conduit (Stream i s t p c) m (Stream i s t p c)
Documentation
reorderFramesBySeqNumC Source #
:: (Default s, Default i, Default t, Default p, Num s, Ord s, Monad m) | |
=> Int | The maximun number of out-of-order frames to buffer. |
-> Conduit (Stream i s t p c) m (Stream i s t p c) |
Reorder the Frame
s in Conduit
of a Stream
according to the Ord
instance of the the sequence numbers of seqNum
. This function will buffer e
certain number of frames that are out of order, and drops frames if they are
too late. Also, when too many consecutive frames have all been dropped, a new
Start
will be created, and the buffered elements are silently dropped, too.
When a Start
is received that internal buffer is flushed and all queued
frames are transmitted.
:: (Monad m, Ord rank, Default i, Default t, Default s, Default p, Default rank) | |
=> Lens' (Stream i s t p c) rank | A lens for the value to be used as comparison |
-> (rank -> rank) | A function that returns the **expected next value** of the comparison value |
-> Int | The maximum number of frames to buffer |
-> Conduit (Stream i s t p c) m (Stream i s t p c) |
Like reorderFramesBySeqNumC
but more general. This function allows to
pass a Lens
to the specific field of each Frame
, that shall be used for
comparison, which governs the order.