wai-eventsource 1.0.0 → 1.1.0
raw patch · 2 files changed
+12/−9 lines, 2 filesdep ~conduitdep ~waidep ~warpPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: conduit, wai, warp
API changes (from Hackage documentation)
Files
src/Network/Wai/EventSource.hs view
@@ -23,10 +23,13 @@ res :: Chan ServerEvent -> Response res chan = ResponseSource statusOK [("Content-Type", "text/event-stream")] $ resE chan -resE :: Chan ServerEvent -> C.Source IO Builder+resE :: Chan ServerEvent -> C.Source IO (C.Flush Builder) resE chan =- C.sourceIO ign (const ign) (const $ fmap (f . eventToBuilder) $ readChan chan)+ C.sourceState Nothing pull where- ign = return ()- f Nothing = C.Closed- f (Just b) = C.Open b+ pull Nothing = do+ x <- liftIO $ readChan chan+ return $ case eventToBuilder x of+ Nothing -> C.StateClosed+ Just y -> C.StateOpen (Just C.Flush) (C.Chunk y)+ pull (Just x) = return $ C.StateOpen Nothing x
wai-eventsource.cabal view
@@ -1,5 +1,5 @@ Name: wai-eventsource-Version: 1.0.0+Version: 1.1.0 Synopsis: WAI support for server-sent events Description: WAI support for server-sent events License: BSD3@@ -17,10 +17,10 @@ base >= 4.3 && < 5 , bytestring >= 0.9.1.4 && < 0.10 , blaze-builder >= 0.3 && < 0.4- , conduit+ , conduit >= 0.2 , http-types >= 0.6 && < 0.7- , wai >= 1.0- , warp >= 1.0+ , wai >= 1.1+ , warp >= 1.1 , transformers ghc-options: -Wall