3 * Copyright (c) 2014, Facebook, Inc.
6 * This source code is licensed under the BSD-style license found in the
7 * LICENSE file in the "hack" directory of this source tree. An additional grant
8 * of patent rights can be found in the PATENTS file in the same directory.
12 class Preparable
<T
> implements Awaitable
<T
> {
13 public function getWaitHandle(): WaitHandle
<T
> {
17 class MyPreparable
extends Preparable
<MyPreparable
> {}
19 async
function foo_one(): Awaitable
<MyPreparable
> {
20 $my_preparable = await (new MyPreparable());
21 return $my_preparable;
24 function foo_two(): Awaitable<array<MyPreparable>> {
25 $my_preparables = yield wait_forv(array(new MyPreparable()));
26 yield result($my_preparables);
29 async
function foo_three(): Awaitable
<(MyPreparable
, MyPreparable
)> {
30 $my_preparables = await
genva(new MyPreparable(), new MyPreparable());
31 return $my_preparables;