[Haskell-cafe] Blocking IO & FIFOs

Wilfried van Asten sniperrifle2004 at gmail.com
Sat Oct 20 16:56:20 CEST 2012


Perhaps an interleaving solution as in process-conduit is still viable:

 - Check if one or both of the fifo's are still ready (Based on your
statement about the reading end receiving EOF hIsEOF should work
here). If both fifos are done the query is finished so break the loop.
 - Check if some output is available on oh. If so read some of it. Repeat.
 - Otherwise check if some output is available on eh. If so read some
of it. Repeat
loop

I also see you don't do anything with the std_out and std_err pipes of
bash as given by runInteractiveProcess. These could also cause a
problem even when the FIFO's are working correctly. Replace these by
handles to the null file or let the output be dumped on the parent's
std_in and std_out (StdStream Inherit).

On Sat, Oct 20, 2012 at 4:00 PM, Jason Dusek <jason.dusek at gmail.com> wrote:
> For my application, it's important to be able to run multiple
> queries against the same Bash session. Waiting for Bash to shut
> down is thus not a viable way to finalize the response.
>
> Perhaps I can spawn two cats with their outputs connected to the
> FIFOs and wait for them to terminate.



More information about the Haskell-Cafe mailing list