packages feed

conduit-extra 1.3.2 → 1.3.3

raw patch · 4 files changed

+18/−8 lines, 4 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Data.Conduit.Process.Typed: nullStream :: () => StreamSpec anyStreamType ()
+ Data.Conduit.Process.Typed: withProcessTerm :: () => ProcessConfig stdin stdout stderr -> (Process stdin stdout stderr -> IO a) -> IO a
+ Data.Conduit.Process.Typed: withProcessTerm_ :: () => ProcessConfig stdin stdout stderr -> (Process stdin stdout stderr -> IO a) -> IO a
+ Data.Conduit.Process.Typed: withProcessWait :: () => ProcessConfig stdin stdout stderr -> (Process stdin stdout stderr -> IO a) -> IO a
+ Data.Conduit.Process.Typed: withProcessWait_ :: () => ProcessConfig stdin stdout stderr -> (Process stdin stdout stderr -> IO a) -> IO a

Files

ChangeLog.md view
@@ -1,5 +1,9 @@ # ChangeLog for conduit-extra +## 1.3.3++* Disable buffering in process modules [#402](https://github.com/snoyberg/conduit/issues/402)+ ## 1.3.2  * Expose `BuilderInput` and `FlushInput`.
Data/Conduit/Process.hs view
@@ -29,8 +29,9 @@ import Data.Streaming.Process.Internal import System.Exit (ExitCode (..)) import Control.Monad.IO.Unlift (MonadIO, liftIO, MonadUnliftIO, withRunInIO, withUnliftIO, unliftIO)-import System.IO (hClose)+import System.IO (hClose, BufferMode (NoBuffering), hSetBuffering) import Data.Conduit+import Data.Functor (($>)) import Data.Conduit.Binary (sourceHandle, sinkHandle, sinkHandleBuilder, sinkHandleFlush) import Data.ByteString (ByteString) import Data.ByteString.Builder (Builder)@@ -41,9 +42,9 @@ #endif  instance (r ~ (), MonadIO m, i ~ ByteString) => InputSource (ConduitM i o m r) where-    isStdStream = (\(Just h) -> return $ sinkHandle h, Just CreatePipe)+    isStdStream = (\(Just h) -> hSetBuffering h NoBuffering $> sinkHandle h, Just CreatePipe) instance (r ~ (), r' ~ (), MonadIO m, MonadIO n, i ~ ByteString) => InputSource (ConduitM i o m r, n r') where-    isStdStream = (\(Just h) -> return (sinkHandle h, liftIO $ hClose h), Just CreatePipe)+    isStdStream = (\(Just h) -> hSetBuffering h NoBuffering $> (sinkHandle h, liftIO $ hClose h), Just CreatePipe)  -- | Wrapper for input source which accepts 'Data.ByteString.Builder.Builder's. -- You can pass 'Data.ByteString.Builder.Extra.flush' to flush the input. Note@@ -68,9 +69,9 @@   isStdStream = (\(Just h) -> return (FlushInput $ sinkHandleFlush h, liftIO $ hClose h), Just CreatePipe)  instance (r ~ (), MonadIO m, o ~ ByteString) => OutputSink (ConduitM i o m r) where-    osStdStream = (\(Just h) -> return $ sourceHandle h, Just CreatePipe)+    osStdStream = (\(Just h) -> hSetBuffering h NoBuffering $> sourceHandle h, Just CreatePipe) instance (r ~ (), r' ~ (), MonadIO m, MonadIO n, o ~ ByteString) => OutputSink (ConduitM i o m r, n r') where-    osStdStream = (\(Just h) -> return (sourceHandle h, liftIO $ hClose h), Just CreatePipe)+    osStdStream = (\(Just h) -> hSetBuffering h NoBuffering $> (sourceHandle h, liftIO $ hClose h), Just CreatePipe)  -- | Given a @CreateProcess@, run the process, with its output being used as a -- @Source@ to feed the provided @Consumer@. Once the process has completed,
Data/Conduit/Process/Typed.hs view
@@ -25,18 +25,23 @@ import Data.IORef (IORef, newIORef, readIORef, modifyIORef) import Control.Exception (throwIO, catch) import Control.Concurrent.Async (concurrently)+import System.IO (hSetBuffering, BufferMode (NoBuffering))  -- | Provide input to a process by writing to a conduit. -- -- @since 1.2.1 createSink :: MonadIO m => StreamSpec 'STInput (ConduitM S.ByteString o m ())-createSink = CB.sinkHandle `fmap` createPipe+createSink =+  (\h -> liftIO (hSetBuffering h NoBuffering) >> CB.sinkHandle h)+  `fmap` createPipe  -- | Read output from a process by read from a conduit. -- -- @since 1.2.1 createSource :: MonadIO m => StreamSpec 'STOutput (ConduitM i S.ByteString m ())-createSource = CB.sourceHandle `fmap` createPipe+createSource =+  (\h -> liftIO (hSetBuffering h NoBuffering) >> CB.sourceHandle h)+  `fmap` createPipe  -- | Internal function: like 'createSource', but stick all chunks into -- the 'IORef'.
conduit-extra.cabal view
@@ -1,5 +1,5 @@ Name:                conduit-extra-Version:             1.3.2+Version:             1.3.3 Synopsis:            Batteries included conduit: adapters for common libraries. Description:     The conduit package itself maintains relative small dependencies. The purpose of this package is to collect commonly used utility functions wrapping other library dependencies, without depending on heavier-weight dependencies. The basic idea is that this package should only depend on haskell-platform packages and conduit.