I'm trying to use Lwt_process.pread_lines to get the output of a few commands. In my Lwt_main.run I call it once, and start processing each line of output separately though Lwt_stream.map, which works well.
In that processing though, if I call another Lwt_process.pread_lines, it seems to be ignored :
Lwt_process.pread_line cmd
>>= Printf.printf "blah %s\n"
I don't get blah, I don't even get an exception. I've tried pread_line and pread_lines, and it looks like anything after >>= is just ignored. If I use |> though it'll get called, but of course I actually need to use the output.
I've read the doc, and looked at the sources of Lwt_process, but I don't see anything indicating that you can't call it as many times as you'd like, it seems to create a new pipe for each process, at least on the output. Of course my external processes aren't using stdin at all, it's just a call to the df command. Am I missing something ?
I should be clear : It doesn't hang, the program does complete fine. It's just never calling whatever is trying to use the result of later commands, the first one works fine.
Thanks