[ 
https://issues.apache.org/jira/browse/MESOS-5038?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15226697#comment-15226697
 ] 

haosdent commented on MESOS-5038:
---------------------------------

Thanks for pointing this! I don't know this before. My concern is it doesn't 
return when future failed or discarded.
{code}
  if (promise->future().isPending()) { // No-op if it's discarded.
    if (future.isReady()) { // We only set the promise if a future is ready.
      promise->set(future);
    }
  }
{code}

> Added a any mechanism for futures
> ---------------------------------
>
>                 Key: MESOS-5038
>                 URL: https://issues.apache.org/jira/browse/MESOS-5038
>             Project: Mesos
>          Issue Type: Improvement
>          Components: libprocess
>            Reporter: haosdent
>            Assignee: haosdent
>
> Now we already have {{collect}} and {{await}} mechanisms which would wait for 
> a list of {{Future}}. However, we would like to return immediately if any of 
> the list of {{Future}} complete instead of wait for the whole list finished 
> in {{collect}}. The interface of this any mechanism could be
> {code}
> template <typename T>
> Future<T> any(const std::list<Future<T>>& futures);
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to