packages feed

unix-process-conduit 0.2.1.2 → 0.2.2

raw patch · 2 files changed

+11/−7 lines, 2 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- Data.Conduit.Process.Unix: monitorProcess :: (ByteString -> IO ()) -> ProcessTracker -> Maybe ByteString -> ByteString -> ByteString -> [ByteString] -> [(ByteString, ByteString)] -> RotatingLog -> IO MonitoredProcess
+ Data.Conduit.Process.Unix: monitorProcess :: (ByteString -> IO ()) -> ProcessTracker -> Maybe ByteString -> ByteString -> ByteString -> [ByteString] -> [(ByteString, ByteString)] -> RotatingLog -> (ExitCode -> IO Bool) -> IO MonitoredProcess

Files

Data/Conduit/Process/Unix.hs view
@@ -77,6 +77,7 @@                                                   length, map, maybe, show, snd,                                                   ($), ($!), (*), (.), (<),                                                   (==))+import           System.Exit                     (ExitCode) import           System.IO                       (hClose) import           System.Posix.IO.ByteString      (FdOption (CloseOnExec),                                                   closeFd, createPipe,@@ -232,7 +233,7 @@ -- child process. -- -- Since 0.2.1-data TrackedProcess = TrackedProcess !ProcessTracker !(IORef MaybePid) !(IO ())+data TrackedProcess = TrackedProcess !ProcessTracker !(IORef MaybePid) !(IO ExitCode)  data MaybePid = NoPid | Pid !CPid @@ -275,8 +276,7 @@     case mpid' of         NoPid -> return ()         Pid _ -> void $ forkIO $ do-            void $ waitForProcess ph-            putMVar baton ()+            waitForProcess ph >>= putMVar baton             untrackProcess tp     return $! tp @@ -370,8 +370,9 @@     -> [S8.ByteString] -- ^ command line parameter     -> [(S8.ByteString, S8.ByteString)] -- ^ environment     -> RotatingLog+    -> (ExitCode -> IO Bool) -- ^ should we restart?     -> IO MonitoredProcess-monitorProcess log processTracker msetuid exec dir args env rlog = do+monitorProcess log processTracker msetuid exec dir args env rlog shouldRestart = do     mstatus <- newMVar NeedsRestart     let loop mlast = do             next <- modifyMVar mstatus $ \status ->@@ -403,8 +404,11 @@                                 log $ "Process created: " `S8.append` exec                                 return (Running pid, do                                     TrackedProcess _ _ wait <- trackProcess processTracker pid-                                    wait-                                    loop (Just now))+                                    ec <- wait+                                    shouldRestart' <- shouldRestart ec+                                    if shouldRestart'+                                        then loop (Just now)+                                        else return ())             next     forkIO $ loop Nothing     return $ MonitoredProcess mstatus
unix-process-conduit.cabal view
@@ -2,7 +2,7 @@ --  documentation, see http://haskell.org/cabal/users-guide/  name:                unix-process-conduit-version:             0.2.1.2+version:             0.2.2 synopsis:            Run processes on Unix systems, with a conduit interface description:         This library allows you to provide @conduit@ datatypes for the input and output streams. Note that you must compile your programs with @-threaded@. homepage:            https://github.com/snoyberg/conduit