on master help sign in
rename exception
commitc7939c1afeace871a2ea731e9a9ab2cca8424c86 authorHarendra Kumar <harendra.kumar@gmail.com> dateThu 26 Oct 2017, 12:09 (9 years ago) parenta90a713
2 files changed+5−5
src/Asyncly.hs+1−1 src/Asyncly/Core.hs+4−4
src/Asyncly.hs+1−1
@@ -54,7 +54,7 @@
5454module Asyncly
5555 ( MonadAsync
5656 , Streaming
57− , ContextUsedAfterEOF
57+ , EndOfStream
5858
5959 -- * Product Style Composition
6060 , StreamT
src/Asyncly/Core.hs+4−4
@@ -19,7 +19,7 @@ module Asyncly.Core
1919 ( Stream (..)
2020 , MonadAsync
2121 , Streaming (..)
22− , ContextUsedAfterEOF (..)
22+ , EndOfStream (..)
2323
2424 -- * Running the Monad
2525 , runStreaming
@@ -304,8 +304,8 @@ sendWorkerWait ctx = do
304304 else void (liftIO $ takeMVar (doorBell ctx))
305305
306306-- | An 'async' stream has finished but is still being used.
307−data ContextUsedAfterEOF = ContextUsedAfterEOF deriving Show
308−instance Exception ContextUsedAfterEOF
307+data EndOfStream = EndOfStream deriving Show
308+instance Exception EndOfStream
309309
310310-- | Pull a stream from a context
311311{-# NOINLINE pullFromCtx #-}
@@ -317,7 +317,7 @@ pullFromCtx ctx = Stream $ \_ stp yld -> do
317317 -- XXX if reading the IORef is costly we can use a flag in the context to
318318 -- indicate we are done.
319319 done <- allThreadsDone ctx
320− when done $ throwM ContextUsedAfterEOF
320+ when done $ throwM EndOfStream
321321
322322 res <- liftIO $ tryTakeMVar (doorBell ctx)
323323 when (isNothing res) $ sendWorkerWait ctx