ecluse:ecluse-core
Safe HaskellNone
LanguageGHC2021

Ecluse.Core.Stream

Description

Byte limits for advisory streams. Callers own the breach effect, so ingestion and runtime downloads can share the traversal without sharing error types.

Synopsis

Documentation

boundBytes :: Monad m => Int -> (Int -> m ()) -> ConduitT ByteString ByteString m () Source #

Preserve chunks up to the byte cap. On breach, pass the observed byte count to the action and stop without yielding the excess chunk, even if the action returns.

boundLines :: Monad m => Int -> (Int -> m ()) -> ConduitT ByteString ByteString m () Source #

Split a stream into lines without their newline, holding at most cap bytes of one line. A longer line passes its length to the action and stops the stream, even if the action returns.