what4-1.5.1: Solver-agnostic symbolic values support for issuing queries
Safe HaskellSafe-Inferred
LanguageHaskell2010

What4.Utils.HandleReader

Synopsis

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 #

demuxProcessHandles Source #

Arguments

:: 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.

Constructors

HandleReader 

Fields

streamLines :: Chan (Maybe Text) -> Handle -> Maybe (OutputStream Text) -> IO () Source #

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 #