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

What4.Utils.HandleReader

Synopsis

Documentation

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 

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