Documentation ¶
Overview ¶
Package future implements a generic future handling system.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrCanceled = errors.New("future canceled")
ErrCanceled is returned by Wait if the future gets canceled while waiting.
var ErrTimeout = errors.New("future timeout")
ErrTimeout is returned by Wait if the specified timeout is exceeded.
Functions ¶
This section is empty.
Types ¶
type Future ¶
type Future struct {
// contains filtered or unexported fields
}
A Future is a low-level future type that can be extended to transport custom information.
func (*Future) Attach ¶ added in v0.14.0
Attach will attach the specified future to this future. If this future is completed or cancelled, all attached futures will be completed or cancelled as well. If this future has already been completed or cancelled the specified future is completed or cancelled immediately.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
A Store is used to store futures.
func (*Store) Await ¶
Await will wait until all futures have completed or cancelled, or the timeout has been reached.
func (*Store) Clear ¶
func (s *Store) Clear()
Clear will cancel all stored futures and remove them if the store is unprotected.