hslogstash-0.3.5: A library to work with, or as, a logstash server

Safe HaskellNone

Data.Conduit.Misc

Description

Various conduit functions, mostly related to grouping or separating the items handled by conduits.

Synopsis

Documentation

concat :: Monad m => Conduit [a] m aSource

Converts a stream of lists into a stream of single elements.

simpleConcatFlush :: Monad m => Int -> Conduit [a] m (Flush a)Source

Converts a stream of [a] into a stream of (Flush a). This is done by sending a Flush when the input is the empty list, or that we reached a certain threshold

concatFlush :: Monad m => b -> (b -> a -> ConduitM [a] (Flush a) m b) -> Conduit [a] m (Flush a)Source

This is a more general version of simpleConcatFlush, where you provide your own fold.

concatFlushSumSource

Arguments

:: (Num n, Ord n, Monad m) 
=> (a -> n)

Convert your input value into an Integer, usually a size

-> n

The threshold value

-> Conduit [a] m (Flush a) 

A generalized version of simpleConcatFlush where some value is summed and the Flush is sent when it reaches a threshold.

groupFlush :: Monad m => Conduit (Flush a) m [a]Source

Regroup a stream of (Flush a) into a stream of lists, using Flush as the separator

mchunk :: b -> (a -> b) -> Flush a -> bSource

Analogous to maybe, but for chunks

mapFlushMaybe :: Monad m => (a -> Maybe b) -> Conduit (Flush a) m (Flush b)Source

Like mapMaybe, but in a Flush. Will not touch the Flush values.