> On March 17, 2014, 7:28 p.m., Dominic Hamon wrote: > > 3rdparty/libprocess/include/process/subprocess.hpp, line 75 > > <https://reviews.apache.org/r/19259/diff/2/?file=520575#file520575line75> > > > > It might be better to add a second method. The way this is written, > > anyone wanting to specify a child function will need to set the > > environment, which may not be useful. > > > > I propose a second method that takes a required function and an > > optional environment. > > Till Toenshoff wrote: > Agreed. > > Benjamin Hindman wrote: > I think as second method would be fine but alternatively just making the > 'environment' be an Option is sufficient and a pattern used in other places > in the code. IIUC the specific use case you're after requires both the > 'environment' && 'setup' so let's make sure that we provide at least that > overload right now.
Used Option<> on both, 'environment' and 'setup' as suggested - makes a lot of sense, I like the result. > On March 17, 2014, 7:28 p.m., Dominic Hamon wrote: > > 3rdparty/libprocess/include/process/subprocess.hpp, line 79 > > <https://reviews.apache.org/r/19259/diff/2/?file=520575#file520575line79> > > > > Is there a reason this is restricted to void() methods only? > > Till Toenshoff wrote: > What should happen if that method returned something? I briefly thought > about using a bool instead and return if that was false. Would that be > something you preferred? > > Ian Downes wrote: > perhaps this should mimic the child function used in clone() on Linux, > which returns int Now returning an int. When that int is non-zero, it overrides the command status code. - Till ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/19259/#review37433 ----------------------------------------------------------- On April 3, 2014, 7:23 p.m., Till Toenshoff wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/19259/ > ----------------------------------------------------------- > > (Updated April 3, 2014, 7:23 p.m.) > > > Review request for mesos, Benjamin Hindman, Dominic Hamon, and Ian Downes. > > > Bugs: MESOS-1102 > https://issues.apache.org/jira/browse/MESOS-1102 > > > Repository: mesos-git > > > Description > ------- > > Adds the ability to process::subprocess to run a function (lambda) within the > child context, after fork and before exec. > > NOTE: Such lambda must not contain any async unsafe code. For details on > async safety, see POSIX.1-2004 on async-signal-safe functions, also > referenced in the signal man-pages: > http://man7.org/linux/man-pages/man7/signal.7.html. > > > Diffs > ----- > > 3rdparty/libprocess/include/process/subprocess.hpp 6c51c0b > 3rdparty/libprocess/src/subprocess.cpp e09c808 > 3rdparty/libprocess/src/tests/subprocess_tests.cpp 9413ecc > > Diff: https://reviews.apache.org/r/19259/diff/ > > > Testing > ------- > > make check > > > Thanks, > > Till Toenshoff > >
