Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- teeInputStream :: InputStream a -> OutputStream a -> IO (InputStream a)
- teeOutputStream :: OutputStream a -> OutputStream a -> IO (OutputStream a)
- lineBufferedOutputStream :: Text -> OutputStream Text -> IO (OutputStream Text)
- demuxProcessHandles :: Handle -> Handle -> Handle -> Maybe (Text, Handle) -> IO (OutputStream Text, InputStream Text, HandleReader)
- data HandleReader = HandleReader {}
- streamLines :: Chan (Maybe Text) -> Handle -> Maybe (OutputStream Text) -> IO ()
- startHandleReader :: Handle -> Maybe (OutputStream Text) -> IO HandleReader
- stopHandleReader :: HandleReader -> IO ()
- withHandleReader :: Handle -> Maybe (OutputStream Text) -> (HandleReader -> IO a) -> IO a
- readNextLine :: HandleReader -> IO (Maybe Text)
- readAllLines :: HandleReader -> IO Text
Documentation
teeInputStream :: InputStream a -> OutputStream a -> IO (InputStream a) Source #
teeOutputStream :: OutputStream a -> OutputStream a -> IO (OutputStream a) Source #
lineBufferedOutputStream :: Text -> OutputStream Text -> IO (OutputStream Text) Source #
:: Handle | stdin for process |
-> Handle | stdout for process |
-> Handle | stderr for process |
-> Maybe (Text, Handle) | |
-> IO (OutputStream Text, InputStream Text, HandleReader) |
data HandleReader Source #
Wrapper to help with reading from another process's standard out and stderr.
We want to be able to read from another process's stderr and stdout without
causing the process to stall because stdout
or stderr
becomes full. This
data type will read from either of the handles, and buffer as much data
as needed in the queue. It then provides a line-based method for reading
that data as strict bytestrings.
startHandleReader :: Handle -> Maybe (OutputStream Text) -> IO HandleReader Source #
Create a new handle reader for reading the given handle.
stopHandleReader :: HandleReader -> IO () Source #
Stop the handle reader; cannot be used afterwards.
withHandleReader :: Handle -> Maybe (OutputStream Text) -> (HandleReader -> IO a) -> IO a Source #
Run an execution with a handle reader and stop it wheen down
readNextLine :: HandleReader -> IO (Maybe Text) Source #
readAllLines :: HandleReader -> IO Text Source #