AnyEvent::Fork clarification

Vikas N Kumar vikas at vikaskumar.org
Tue Jan 7 17:02:07 CET 2014


On 01/07/2014 10:07 AM, Marc Lehmann wrote:
> Now, the subprocess side of the handle might or might not be set to
> close-on-exec (AnyEvent::Fork doesn't normally touch it), so in addition you
> should mark the handle as not-close-on-exec ("use Proc::FastSpawn; fd_inherit
> $fh, 1").
>
> This will have the effect of any process you exec (and any process that
> process execs) to inherit the fd, which will therefore stay open as long
> as at leats one of the processes started is still running, which might be
> better (or worse) then waiting for the exec'ed child.
Yes this was it. This is absolutely needed to track if the child has
exited. When the inherited fd is closed by the child on its exit the
parent gets notified every time which is what I wanted !





More information about the anyevent mailing list