Commit 16a70848 authored by Michael Park's avatar Michael Park Committed by Facebook GitHub Bot

Removed out-dated notes from `Futures.md`.

Summary:
The examples showing `thenValue(executor, ...)` is outdated since the executor-taking form of `then` have been `delete`d.

The example showing racy execution of continuations of `Future`s is no longer relevant. It used to be a valid example when the `Future`s used to be "activated" on destruction, but they no longer have this behavior.

Fixes #1422.

Reviewed By: LeeHowes

Differential Revision: D23181958

fbshipit-source-id: 46d2bedd4fef344734d3eb15eb295b9a98969665
parent cad3b5cf
......@@ -206,23 +206,7 @@ std::move(aFuture)
.via(e2).thenValue(z);
```
`x` will execute in the context of the executor associated with `aFuture`. `y1` and `y2` will execute in the context of `e1`, and `z` will execute in the context of `e2`. If after `z` you want to get back to the original context, you need to get there with a call to `via` passing the original executor. Another way to express this is using an overload of `then` that takes an Executor:
```cpp
std::move(aFuture)
.thenValue(x)
.thenValue(e1, y1, y2)
.thenValue(e2, z);
```
Either way, there is no ambiguity about which executor will run `y1`, `y2`, or `z`.
You can still have a race after `via` if you break it into multiple statements, e.g. in this counterexample:
```cpp
f2 = std::move(f).via(e1).thenValue(y1).thenValue(y2); // nothing racy here
std::move(f2).thenValue(y3); // racy
```
`x` will execute in the context of the executor associated with `aFuture`. `y1` and `y2` will execute in the context of `e1`, and `z` will execute in the context of `e2`. If after `z` you want to get back to the original context, you need to get there with a call to `via` passing the original executor.
# You make me Promises, Promises
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment