| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Simplex.Chat.Messages.Batch
Synopsis
- data MsgBatch = MsgBatch ByteString [SndMessage]
- batchMessages :: Int -> [Either ChatError SndMessage] -> [Either ChatError MsgBatch]
- batchDeliveryTasks1 :: VersionRangeChat -> Int -> NonEmpty MessageDeliveryTask -> (ByteString, [Int64], [Int64])
Documentation
Constructors
| MsgBatch ByteString [SndMessage] |
batchMessages :: Int -> [Either ChatError SndMessage] -> [Either ChatError MsgBatch] Source #
Batches SndMessages in [Either ChatError SndMessage] into batches of ByteStrings in form of JSON arrays. Preserves original errors in the list. Does not check if the resulting batch is a valid JSON. If a single element is passed, it is returned as is (a JSON string). If an element exceeds maxLen, it is returned as ChatError.
batchDeliveryTasks1 :: VersionRangeChat -> Int -> NonEmpty MessageDeliveryTask -> (ByteString, [Int64], [Int64]) Source #
Batches delivery tasks into (batch, [taskIds], [largeTaskIds]).