----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/61149/#review191464 -----------------------------------------------------------
3rdparty/libprocess/include/process/future.hpp Lines 1782-1804 (patched) <https://reviews.apache.org/r/61149/#comment269287> Something like this? ``` const std::string suffix = future.data->discard ? " (with discard)" : ""; switch (future.data->state) { case Future<T>::PENDING: if (future.data->abandoned) { return stream << "Abandoned" << suffix; } return stream << "Pending" << suffix; case Future<T>::READY: // TODO(benh): Stringify `Future<T>::get()` if it can be // stringified (will need to be SFINAE'ed appropriately). return stream << "Ready" << suffix; case Future<T>::FAILED: return stream << "Failed" << suffix << ": " << future.failure(); case Future<T>::DISCARDED: return stream << "Discarded" << suffix; } ``` - Benjamin Mahler On July 27, 2017, 1:55 a.m., Benjamin Hindman wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/61149/ > ----------------------------------------------------------- > > (Updated July 27, 2017, 1:55 a.m.) > > > Review request for mesos and Benjamin Mahler. > > > Repository: mesos > > > Description > ------- > > This is especially useful when creating error messages and the future > has failed or been discarded. > > > Diffs > ----- > > 3rdparty/libprocess/include/process/future.hpp > a11a588941b02d776da2f563dd246a92dfbbc360 > 3rdparty/libprocess/src/tests/future_tests.cpp > 76a32bd69499e52ea1623ab982d65e1c7a0cbd32 > > > Diff: https://reviews.apache.org/r/61149/diff/3/ > > > Testing > ------- > > make check > > > Thanks, > > Benjamin Hindman > >
