Documentation ¶
Overview ¶
Package helpers provides some utility functions for asyncmachine, which are out of scope of the main package.
Index ¶
- func ErrFromCtxs(ctxs ...context.Context) error
- func NestedState(e *am.Event, strIDField string, machGetter func(id string) *am.Machine) (am.Result, <-chan struct{}, error)
- func RaceCtx[T *any](ctx context.Context, ch chan T) (T, error)
- func RelationsMatrix(mach *am.Machine) ([][]int, error)
- func TimeMatrix(machines []*am.Machine) ([]am.Time, error)
- func TransitionMatrix(tx, prevTx *am.Transition, index am.S) ([][]int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrFromCtxs ¶
ErrFromCtxs returns the first non-nil error from a list of contexts.
func NestedState ¶
func NestedState( e *am.Event, strIDField string, machGetter func(id string) *am.Machine, ) (am.Result, <-chan struct{}, error)
NestedState forwards the mutation to one of the composed submachines. Parent state should be a Multi state and only called directly (not from a relation). TODO test case, solve locking by passing the event to the submachine
func TimeMatrix ¶
TimeMatrix returns a matrix of state clocks for the given machines.
func TransitionMatrix ¶ added in v0.6.4
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.