Documentation
¶
Index ¶
- func NewCompositeFuture[V any](ctx context.Context) (*CompositeFuture[V], CompositeFutureResolver[V])
- func NewFuture(ctx context.Context) (*Future, FutureResolver)
- func NewValueFuture[V any](ctx context.Context) (*ValueFuture[V], ValueFutureResolver[V])
- type CompositeFuture
- type CompositeFutureResolver
- type Future
- type FutureResolver
- type ValueFuture
- type ValueFutureResolver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCompositeFuture ¶
func NewCompositeFuture[V any](ctx context.Context) (*CompositeFuture[V], CompositeFutureResolver[V])
func NewValueFuture ¶
func NewValueFuture[V any](ctx context.Context) (*ValueFuture[V], ValueFutureResolver[V])
Types ¶
type CompositeFuture ¶
type CompositeFuture[V any] struct { // contains filtered or unexported fields }
func (*CompositeFuture[V]) Cancel ¶ added in v2.1.0
func (f *CompositeFuture[V]) Cancel(cause error)
func (*CompositeFuture[V]) Context ¶ added in v2.0.3
func (f *CompositeFuture[V]) Context() context.Context
func (*CompositeFuture[V]) Done ¶ added in v2.1.0
func (f *CompositeFuture[V]) Done(count int) <-chan struct{}
func (*CompositeFuture[V]) Wait ¶ added in v2.0.1
func (f *CompositeFuture[V]) Wait(count int) ([]V, error)
type CompositeFutureResolver ¶
type Future ¶
type Future struct {
// contains filtered or unexported fields
}
A Future represents a value that will be available in the Future. It is always associated with a context that can be used to wait for the value to be available. When the parent context is canceled, the Future will be canceled as well.
type FutureResolver ¶
type FutureResolver func(err error)
type ValueFuture ¶
type ValueFuture[V any] struct { // contains filtered or unexported fields }
A Future represents a value that will be available in the Future. It is always associated with a context that can be used to wait for the value to be available. When the parent context is canceled, the Future will be canceled as well.
func (*ValueFuture[V]) Done ¶
func (f *ValueFuture[V]) Done() <-chan struct{}
func (*ValueFuture[V]) Result ¶
func (f *ValueFuture[V]) Result() (V, error)
func (*ValueFuture[V]) Wait ¶
func (f *ValueFuture[V]) Wait() (V, error)
Get waits for the future to complete and returns the output and any error that occurred.
type ValueFutureResolver ¶
Click to show internal directories.
Click to hide internal directories.