Safe Haskell | None |
---|
This is an alternative version of the module System.Process.ListLike.Read that doesn't use forkIO. I don't know of any advantages, I'm just including it because it is derived from old code I had developed, it is kinda badass, and maybe someone has a use for it.
Function to run a process and return a lazy list of chunks from standard output, standard error, and at the end of the list an object indicating the process result code. If neither output handle is ready for reading the process sleeps and tries again, with the sleep intervals increasing from 8 microseconds to a maximum of 0.1 seconds.
- class ListLikeLazyIO a c => ListLikeIOPlus a c where
- hPutNonBlocking :: Handle -> a -> IO a
- chunks :: a -> [a]
- readCreateProcess :: forall a b c. (ListLikeIOPlus a c, ProcessOutput a b) => CreateProcess -> a -> IO b
- readCreateProcessWithExitCode :: ListLikeIOPlus a c => CreateProcess -> a -> IO (ExitCode, a, a)
- readProcessWithExitCode :: ListLikeIOPlus a c => FilePath -> [String] -> a -> IO (ExitCode, a, a)
Documentation
class ListLikeLazyIO a c => ListLikeIOPlus a c whereSource
For the unthreaded implementation we need a more powerful ListLikeLazyIO class.
hPutNonBlocking :: Handle -> a -> IO aSource
ListLikeIOPlus ByteString Word8 | |
ListLikeIOPlus Text Char |
readCreateProcess :: forall a b c. (ListLikeIOPlus a c, ProcessOutput a b) => CreateProcess -> a -> IO bSource
readCreateProcessWithExitCode :: ListLikeIOPlus a c => CreateProcess -> a -> IO (ExitCode, a, a)Source
readProcessWithExitCode :: ListLikeIOPlus a c => FilePath -> [String] -> a -> IO (ExitCode, a, a)Source