You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by be...@apache.org on 2012/02/16 01:45:34 UTC
svn commit: r1244810 -
/incubator/mesos/trunk/third_party/libprocess/include/process/collect.hpp
Author: benh
Date: Thu Feb 16 00:45:34 2012
New Revision: 1244810
URL: http://svn.apache.org/viewvc?rev=1244810&view=rev
Log:
Updated semantics of collect (on futures) and updated documentation appropriately.
Modified:
incubator/mesos/trunk/third_party/libprocess/include/process/collect.hpp
Modified: incubator/mesos/trunk/third_party/libprocess/include/process/collect.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/libprocess/include/process/collect.hpp?rev=1244810&r1=1244809&r2=1244810&view=diff
==============================================================================
--- incubator/mesos/trunk/third_party/libprocess/include/process/collect.hpp (original)
+++ incubator/mesos/trunk/third_party/libprocess/include/process/collect.hpp Thu Feb 16 00:45:34 2012
@@ -11,7 +11,10 @@
namespace process {
-// Transforms a set of futures of type T into a set of T's.
+// Waits on each future in the specified set and returns the set of
+// resulting values. If any future is discarded then the result will
+// be a failure. Likewise, if any future fails than the result future
+// will be a failure.
template <typename T>
Future<std::set<T> > collect(std::set<Future<T> >& futures);
@@ -53,9 +56,9 @@ private:
void waited(const Future<T>& future)
{
if (future.isFailed()) {
- promise->fail(future.failure());
+ promise->fail("Collect failed: " + future.failure());
} else if (future.isDiscarded()) {
- promise->future().discard();
+ promise->fail("Collect failed: future discarded");
} else {
assert(future.isReady());
values.insert(future.get());