Skip to content

Instantly share code, notes, and snippets.

@KirinDave
Created July 1, 2011 04:07
Show Gist options
  • Save KirinDave/1057855 to your computer and use it in GitHub Desktop.
Save KirinDave/1057855 to your computer and use it in GitHub Desktop.
Amping up the redis client library in haskell.
subscriptionEnumerator :: (BS s, MonadIO m) =>
Redis
-> Int
-> Enumerator (Message s) m b
subscriptionEnumerator rs timeout (Continue k) = do
nextRead <- liftIO $ listen rs timeout;
let chunk = Chunks $ maybeToList nextRead in
k chunk >>== subscriptionEnumerator rs timeout
subscriptionEnumerator rs timeout step = returnI step
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment