Safe Haskell | None |
---|
Quick conduit for reading from Redis lists. Not tested much, and probably quite slow.
- redisSource :: MonadResource m => HostName -> Int -> ByteString -> Int -> Integer -> Source m [ByteString]
- redisSink :: MonadResource m => HostName -> Int -> ByteString -> Maybe (ByteString -> IO ()) -> Sink ByteString m ()
Documentation
:: 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.
:: 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.