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

Ship it!



3rdparty/libprocess/include/process/future.hpp
<https://reviews.apache.org/r/29535/#comment110366>

    This is great! Here are just some thoughts on how should we use this 
primitive.
    
    In many cases, we want to do async operation chaining. For example:
    ```
    Future f = async1()
      .then(async2)
      .then(async3)
      ....
    ```
    
    If any of the async operations returns error in the above chain, the chain 
will short cut and return a failure. Sometimes, however, we want to execute all 
the async operations even if some of them have failures (probably different 
behavior in the case of failure). So we probably would do something like the 
following using this primitive:
    
    ```
    Future f = async1()
      .repair(r1)   // r1 returns a Future<Future<X>> so that async2 can use 
the passed-in Future<X> to decide it's action.
      .then(async2)
      .repair(r2)  // Ditto.
      .then(...)
      ...
    ```
    
    The only unfortunate part here is that r1 needs to return Future<Future<X>> 
which is a little unintuititve.


- Jie Yu


On Jan. 2, 2015, 4:46 a.m., Benjamin Hindman wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/29535/
> -----------------------------------------------------------
> 
> (Updated Jan. 2, 2015, 4:46 a.m.)
> 
> 
> Review request for mesos and Adam B.
> 
> 
> Repository: mesos-git
> 
> 
> Description
> -------
> 
> See summary.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/include/process/future.hpp 
> 0326b23cdd475c6e86b33f9b4c63136fdecab443 
>   3rdparty/libprocess/src/tests/process_tests.cpp 
> 3bbfe0a7a65acb52d139fda81816acf305d891f5 
> 
> Diff: https://reviews.apache.org/r/29535/diff/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Benjamin Hindman
> 
>

Reply via email to