mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jie Yu" <yujie....@gmail.com>
Subject Re: Review Request 40559: Added a wait() function to Subprocess.
Date Fri, 20 Nov 2015 21:06:38 GMT

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/40559/
-----------------------------------------------------------

(Updated Nov. 20, 2015, 9:06 p.m.)


Review request for mesos, Ben Mahler and Vinod Kone.


Bugs: MESOS-3035
    https://issues.apache.org/jira/browse/MESOS-3035


Repository: mesos


Description (updated)
-------

Added a wait() function to Subprocess. This is similar to `Popen.communicate(None)` in python.
See the example code below:

```
Try<Subprocess> s = subprocess(...);
if (s.isError()) {
  ...
}

return s.get().wait()
  .then([](const Subprocess::Result& result) {
    if (result.status.isNone()) { ... }
    if (result.status.get() != 0) { ... }
    
    handle(result.out.get());
    handle(result.err.get());
  });
```

Relevant review: https://reviews.apache.org/r/37336/


Diffs
-----

  3rdparty/libprocess/include/process/subprocess.hpp f17816e813d5efce1d3bb1ff1e1111850eeda3ba

  3rdparty/libprocess/src/subprocess.cpp e51f024e89594d84f1dfb7ee6f2e1d8fb33b4a08 
  3rdparty/libprocess/src/tests/subprocess_tests.cpp ac600a551fb1a7782ff33cce204b7819497ef54a


Diff: https://reviews.apache.org/r/40559/diff/


Testing
-------

make check


Thanks,

Jie Yu


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message