On Tue, Dec 6, 2011 at 4:17 PM, Peter Odding <
peter@peterodding.com> wrote:
>> We are running an external process using io.popen(). Something like ...
>>
>> ecom = assert(io.popen(cmd, 'r'))
>>
>> Is there a way to setup non-blocking reads with this type of interface?
>> Or do other lua modules offer more control? What we've seen is that our
>> read() command will block if the external process does not have any data
>> to return. We need a strategy to make this non-blocking.
>>
>> Thanks for any suggestions,
>>
>> Joe
>
>
> I don't know whether it's possible or easy to make pipes created by
> io.popen() non-blocking, however my Lua/APR binding [1] supports process
> management and pipes with configurable blocking behaviour (non-blocking,
> blocking and blocking with time out). It works in Windows and UNIX
> environments (and then some).
>
> - Peter
>
> [1]
http://peterodding.com/code/lua/apr/
>