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

Safe HaskellNone

Data.Conduit.Redis

Description

Quick conduit for reading from Redis lists. Not tested much, and probably quite slow.

Synopsis

Documentation

redisSourceSource

Arguments

:: MonadResource m 
=> HostName

Hostname of the Redis server

-> Int

Port of the Redis server (usually 6379)

-> ByteString

Name of the list

-> Int

Number of elements to pop at once

-> Integer

Timeout of the brpop function in seconds, useful for getting Flush events into your conduit. Set to 0 for no timeout.

-> Source m [ByteString] 

This is a source that pops elements from a Redis list. It is capable of poping several elements at once, and will return lists of ByteStrings. You might then use concat or the flushing facilities in Data.Conduit.Misc to work with individual elements.

redisSinkSource

Arguments

:: MonadResource m 
=> HostName

Hostname of the Redis server

-> Int

Port of the Redis server (usually 6379)

-> ByteString

Name of the list

-> Maybe (ByteString -> IO ())

Command used to log various errors. Defaults to BS.putStrLn. It must not fail, so be careful about exceptions.

-> Sink ByteString m () 

A Sink that will let you write ByteStrings to a redis queue. It can be augmented with a logging function, that will be able to report errors.