Documentation
¶
Overview ¶
Generic Concurrency primitives.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Step ¶
type Step[T any] struct { // contains filtered or unexported fields }
Step represents a computation that may produce a value. This is equivalent to a `Future` in other languages.
func New ¶
Create a new Step not predicated on any other step. `f` is the computation that the step represents. The second return value indicates if the computation succeeded.
func (*Step[T]) GetResult ¶
Block on retrieving the computed result. If the computation is canceled, Zero[T](), false is returned.
func (*Step[T]) TryGetResult ¶
A non-blocking attempt to retrieve the value produced by the Step. The bool is true if a computed value is returned. False indicates that the attempt failed.
Click to show internal directories.
Click to hide internal directories.