mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benjamin Hindman <b...@berkeley.edu>
Subject Re: Review Request 62252: Added `process::Executor::execute()`.
Date Fri, 15 Sep 2017 00:36:39 GMT

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




3rdparty/libprocess/include/process/executor.hpp
Lines 62 (patched)
<https://reviews.apache.org/r/62252/#comment261762>

    What about a function that returns a `Future` all ready? I think we should flatten the
result on behalf of the user, rather than getting back a `Future<Future<string>>`.
Let's add a test for this case too please!



3rdparty/libprocess/include/process/executor.hpp
Lines 63 (patched)
<https://reviews.apache.org/r/62252/#comment261761>

    Let's still take a universal reference for `F`, e.g., `F&&`. Then we can `std::forward<F>(f)`
to `dispatch()`. Same below even though we make a copy, eventually we'll be able to forward
it as a lambda capture.



3rdparty/libprocess/include/process/executor.hpp
Lines 68-75 (patched)
<https://reviews.apache.org/r/62252/#comment261763>

    Can we comment that this overload for `void` returns `Future<Nothing>` specifically
so we can chain? And that it follows the `async()` pattern? It'll be great for future readers
(including ourselves!) to understand (or rememeber) why we made this design decision.



3rdparty/libprocess/src/tests/process_tests.cpp
Lines 1238 (patched)
<https://reviews.apache.org/r/62252/#comment261764>

    For the non-void returning function it seems unnecessary to also check `f2Result`. I'd
suggest we simplify the test so nobody is guessing whether or not that part is really testing
anything.
    
    And what about using a `Promise<Nothing>` inside the void function instead of a
`std::atomic<int>`? Or even a `Latch`?
    
    And let's add a test for a function/lambda that already returns a `Future`.


- Benjamin Hindman


On Sept. 13, 2017, 5:34 p.m., Chun-Hung Hsiao wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/62252/
> -----------------------------------------------------------
> 
> (Updated Sept. 13, 2017, 5:34 p.m.)
> 
> 
> Review request for mesos, Benjamin Hindman and Benjamin Mahler.
> 
> 
> Bugs: MESOS-7970
>     https://issues.apache.org/jira/browse/MESOS-7970
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> This patch adds a convenient interface to `process::Executor` to
> asynchronously execute arbitrary functions.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/include/process/executor.hpp cd2f2f03cba8a435f142b31def9f89a6cd61af73

>   3rdparty/libprocess/src/tests/process_tests.cpp 82efb2f8449e4cb13620cae1a49321fc42e2db60

> 
> 
> Diff: https://reviews.apache.org/r/62252/diff/3/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Chun-Hung Hsiao
> 
>


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