29
)
30
32
>
var value T
33
>
return &FutureImpl[T]{
34
>
status: pending,
35
>
readyCh: make(chan struct{}),
36
>
37
>
value: value,
38
>
err: nil,
39
>
}
40
>
}
41
42
func (f *FutureImpl[T]) Get(
43
ctx context.Context,
45
>
if f.Ready() {
47
>
}
48
51
>
return f.value, f.err
52
case <-ctx.Done():
53
var value T