simplex-chat-6.5.0.7
Safe HaskellNone
LanguageHaskell2010

Simplex.Chat.Messages.Batch

Synopsis

Documentation

data MsgBatch Source #

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]).