Last active
December 3, 2019 11:12
-
-
Save kutyel/f105637cb3167b8a2c543e069548792c to your computer and use it in GitHub Desktop.
If there was no Conduit.mapM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getPersonStream :: ConduitT () PeopleRequest ServerErrorIO () | |
-> ConduitT PeopleResponse Void ServerErrorIO () | |
-> ServerErrorIO () | |
getPersonStream source sink = runConduit $ source .| reStream .| sink | |
where | |
reStream = do | |
req <- await | |
case req of | |
Nothing -> return () | |
Just r -> do | |
liftIO $ threadDelay (2 * 1000 * 1000) | |
yield $ evolvePerson r | |
reStream |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment