Commit 9df5962
Add Condition->trySucceed and Condition->tryFail (facebook#185)
Summary:
It would allow for use cases like this:
```
async function outer(): Awaitable<void> {
await wait_for_notification_async(
async $notifyee ==> {
concurrent {
await async {
await gen_usleep(100);
$notifyee->trySucceed("fast condition");
}
await async {
await gen_usleep(10000000000);
$notifyee->trySucceed("slow condition");
}
}
}
);
}
```
X-link: hhvm/hsl#185
Reviewed By: fredemmott
Differential Revision: D34903436
Pulled By: Atry
fbshipit-source-id: 859d72707fa338df22522c778c35f47c234977461 parent a0db154 commit 9df5962
1 file changed
+34
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
24 | 42 | | |
25 | 43 | | |
26 | 44 | | |
27 | 45 | | |
| 46 | + | |
28 | 47 | | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
33 | 51 | | |
34 | 52 | | |
| 53 | + | |
35 | 54 | | |
36 | 55 | | |
37 | 56 | | |
38 | 57 | | |
39 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
40 | 63 | | |
41 | | - | |
| 64 | + | |
42 | 65 | | |
43 | 66 | | |
44 | 67 | | |
45 | 68 | | |
| 69 | + | |
46 | 70 | | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
51 | 74 | | |
| 75 | + | |
52 | 76 | | |
53 | 77 | | |
54 | 78 | | |
| |||
0 commit comments