package machine

Import Path
	/pkg/machine (on go.dev)

Dependency Relation
	imports 18 packages, and imported by 74 packages

Involved Source Files Package machine is a nondeterministic, multi-state, clock-based, relational, optionally-accepting, and non-blocking state machine. misc_mach.go mutation.go relations.go schema.go subscriptions.go transition.go types.go utils.go
Package-Level Type Names (total 58)
/* sort by: | */
A (arguments) is a map of named arguments for a [Mutation]. func Pass(args *AT) A func PassMerge(existing A, args *AT) A func (*Transition).Args() A func github.com/pancsta/asyncmachine-go/pkg/node.Pass(args *node.A) A func github.com/pancsta/asyncmachine-go/pkg/node.PassRpc(args *node.A) A func github.com/pancsta/asyncmachine-go/pkg/pubsub.Pass(args *pubsub.A) A func github.com/pancsta/asyncmachine-go/pkg/rpc.Pass(args *rpc.A) A func github.com/pancsta/asyncmachine-go/pkg/rpc.PassRpc(args *rpc.A) A func github.com/pancsta/asyncmachine-go/examples/cli_daemon/types.Pass(args *types.A) A func github.com/pancsta/asyncmachine-go/examples/cli_daemon/types.PassRpc(args *types.ARpc) A func github.com/pancsta/asyncmachine-go/examples/mach_template.Pass(args *main.A) A func github.com/pancsta/asyncmachine-go/examples/mach_template.PassRpc(args *main.ARpc) A func github.com/pancsta/asyncmachine-go/tools/repl.Pass(args *repl.A) A func ParseArgs(args A) *AT func PassMerge(existing A, args *AT) A func Api.Add(states S, args A) Result func Api.Add1(state string, args A) Result func Api.AddErr(err error, args A) Result func Api.AddErrState(state string, err error, args A) Result func Api.CanAdd(states S, args A) Result func Api.CanAdd1(state string, args A) Result func Api.CanRemove(states S, args A) Result func Api.CanRemove1(state string, args A) Result func Api.EvAdd(event *Event, states S, args A) Result func Api.EvAdd1(event *Event, state string, args A) Result func Api.EvAddErr(event *Event, err error, args A) Result func Api.EvAddErrState(event *Event, state string, err error, args A) Result func Api.EvRemove(event *Event, states S, args A) Result func Api.EvRemove1(event *Event, state string, args A) Result func Api.EvToggle(event *Event, states S, args A) Result func Api.EvToggle1(event *Event, state string, args A) Result func Api.Remove(states S, args A) Result func Api.Remove1(state string, args A) Result func Api.Set(states S, args A) Result func Api.Toggle(states S, args A) Result func Api.Toggle1(state string, args A) Result func Api.WhenArgs(state string, args A, ctx context.Context) <-chan struct{} func (*Event).SwapArgs(args A) *Event func (*Machine).Add(states S, args A) Result func (*Machine).Add1(state string, args A) Result func (*Machine).AddErr(err error, args A) Result func (*Machine).AddErrState(state string, err error, args A) Result func (*Machine).CanAdd(states S, args A) Result func (*Machine).CanAdd1(state string, args A) Result func (*Machine).CanRemove(states S, args A) Result func (*Machine).CanRemove1(state string, args A) Result func (*Machine).EvAdd(event *Event, states S, args A) Result func (*Machine).EvAdd1(event *Event, state string, args A) Result func (*Machine).EvAddErr(event *Event, err error, args A) Result func (*Machine).EvAddErrState(event *Event, state string, err error, args A) Result func (*Machine).EvRemove(event *Event, states S, args A) Result func (*Machine).EvRemove1(event *Event, state string, args A) Result func (*Machine).EvToggle(e *Event, states S, args A) Result func (*Machine).EvToggle1(e *Event, state string, args A) Result func (*Machine).PanicToErr(args A) func (*Machine).PanicToErrState(state string, args A) func (*Machine).Remove(states S, args A) Result func (*Machine).Remove1(state string, args A) Result func (*Machine).Set(states S, args A) Result func (*Machine).Toggle(states S, args A) Result func (*Machine).Toggle1(state string, args A) Result func (*Machine).WhenArgs(state string, args A, ctx context.Context) <-chan struct{} func (*Subscriptions).WhenArgs(state string, args A, ctx context.Context) <-chan struct{} func github.com/pancsta/asyncmachine-go/pkg/helpers.Add1Async(ctx context.Context, mach Api, waitState string, addState string, args A) Result func github.com/pancsta/asyncmachine-go/pkg/helpers.Add1Block(ctx context.Context, mach Api, state string, args A) Result func github.com/pancsta/asyncmachine-go/pkg/helpers.Add1Sync(ctx context.Context, mach Api, state string, args A) Result func github.com/pancsta/asyncmachine-go/pkg/helpers.ArgsFromMap[T](args A, dest T) T func github.com/pancsta/asyncmachine-go/pkg/helpers.AskAdd(mach Api, states S, args A) Result func github.com/pancsta/asyncmachine-go/pkg/helpers.AskAdd1(mach Api, state string, args A) Result func github.com/pancsta/asyncmachine-go/pkg/helpers.AskEvAdd(e *Event, mach Api, states S, args A) Result func github.com/pancsta/asyncmachine-go/pkg/helpers.AskEvAdd1(e *Event, mach Api, state string, args A) Result func github.com/pancsta/asyncmachine-go/pkg/helpers.AskEvRemove(e *Event, mach Api, states S, args A) Result func github.com/pancsta/asyncmachine-go/pkg/helpers.AskEvRemove1(e *Event, mach Api, state string, args A) Result func github.com/pancsta/asyncmachine-go/pkg/helpers.AskRemove(mach Api, states S, args A) Result func github.com/pancsta/asyncmachine-go/pkg/helpers.AskRemove1(mach Api, state string, args A) Result func github.com/pancsta/asyncmachine-go/pkg/helpers.CantAdd(mach Api, states S, args A) bool func github.com/pancsta/asyncmachine-go/pkg/helpers.CantAdd1(mach Api, state string, args A) bool func github.com/pancsta/asyncmachine-go/pkg/helpers.CantRemove(mach Api, states S, args A) bool func github.com/pancsta/asyncmachine-go/pkg/helpers.CantRemove1(mach Api, state string, args A) bool func github.com/pancsta/asyncmachine-go/pkg/helpers.NewMutRequest(mach Api, mutType MutationType, states S, args A) *helpers.MutRequest func github.com/pancsta/asyncmachine-go/pkg/helpers.NewReqAdd(mach Api, states S, args A) *helpers.MutRequest func github.com/pancsta/asyncmachine-go/pkg/helpers.NewReqAdd1(mach Api, state string, args A) *helpers.MutRequest func github.com/pancsta/asyncmachine-go/pkg/helpers.NewReqRemove(mach Api, states S, args A) *helpers.MutRequest func github.com/pancsta/asyncmachine-go/pkg/helpers.NewReqRemove1(mach Api, state string, args A) *helpers.MutRequest func github.com/pancsta/asyncmachine-go/pkg/helpers.(*MutRequest).Clone(mach Api, mutType MutationType, states S, args A) *helpers.MutRequest func github.com/pancsta/asyncmachine-go/pkg/integrations/nats.Add(ctx context.Context, nc *nats.Conn, topic, machID string, states S, args A) (Result, error) func github.com/pancsta/asyncmachine-go/pkg/integrations/nats.Remove(ctx context.Context, nc *nats.Conn, machID, topic string, states S, args A) (Result, error) func github.com/pancsta/asyncmachine-go/pkg/node.AddErrPool(mach *Machine, err error, args A) error func github.com/pancsta/asyncmachine-go/pkg/node.AddErrPoolStr(mach *Machine, msg string, args A) error func github.com/pancsta/asyncmachine-go/pkg/node.AddErrRpc(mach *Machine, err error, args A) error func github.com/pancsta/asyncmachine-go/pkg/node.AddErrWorker(event *Event, mach *Machine, err error, args A) error func github.com/pancsta/asyncmachine-go/pkg/node.AddErrWorkerStr(mach *Machine, msg string, args A) error func github.com/pancsta/asyncmachine-go/pkg/node.LogArgs(args A) map[string]string func github.com/pancsta/asyncmachine-go/pkg/node.ParseArgs(args A) *node.A func github.com/pancsta/asyncmachine-go/pkg/pubsub.AddErrJoining(event *Event, mach *Machine, err error, args A) error func github.com/pancsta/asyncmachine-go/pkg/pubsub.AddErrListening(event *Event, mach *Machine, err error, args A) error func github.com/pancsta/asyncmachine-go/pkg/pubsub.LogArgs(args A) map[string]string func github.com/pancsta/asyncmachine-go/pkg/pubsub.ParseArgs(args A) *pubsub.A func github.com/pancsta/asyncmachine-go/pkg/rpc.LogArgs(args A) map[string]string func github.com/pancsta/asyncmachine-go/pkg/rpc.ParseArgs(args A) *rpc.A func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).Add(states S, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).Add1(state string, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).Add1NS(state string, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).AddErr(err error, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).AddErrState(state string, err error, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).AddNS(states S, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).CanAdd(states S, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).CanAdd1(state string, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).CanRemove(states S, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).CanRemove1(state string, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).EvAdd(event *Event, states S, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).EvAdd1(event *Event, state string, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).EvAddErr(event *Event, err error, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).EvAddErrState(event *Event, state string, err error, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).EvRemove(event *Event, states S, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).EvRemove1(event *Event, state string, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).EvToggle(e *Event, states S, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).EvToggle1(e *Event, state string, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).Remove(states S, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).Remove1(state string, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).Set(states S, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).Toggle(states S, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).Toggle1(state string, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).WhenArgs(state string, args A, ctx context.Context) <-chan struct{} func github.com/pancsta/asyncmachine-go/pkg/states.AddErrConnecting(event *Event, mach *Machine, err error, args A) error func github.com/pancsta/asyncmachine-go/examples/cli_daemon/types.LogArgs(args A) map[string]string func github.com/pancsta/asyncmachine-go/examples/cli_daemon/types.ParseArgs(args A) *types.A func github.com/pancsta/asyncmachine-go/examples/mach_template.AddErrExample(event *Event, mach *Machine, err error, args A) error func github.com/pancsta/asyncmachine-go/examples/mach_template.LogArgs(args A) map[string]string func github.com/pancsta/asyncmachine-go/examples/mach_template.ParseArgs(args A) *main.A func github.com/pancsta/asyncmachine-go/tools/repl.AddErrSyntax(event *Event, mach *Machine, err error, args A) error func github.com/pancsta/asyncmachine-go/tools/repl.LogArgs(args A) map[string]string func github.com/pancsta/asyncmachine-go/tools/repl.ParseArgs(args A) *repl.A
Api is a subset of Machine for alternative implementations. ActiveStates is [Machine.ActiveStates]. Add is [Machine.Add]. Add1 is [Machine.Add1]. AddBreakpoint is [Machine.AddBreakpoint]. AddBreakpoint1 is [Machine.AddBreakpoint1]. AddErr is [Machine.AddErr]. AddErrState is [Machine.AddErrState]. Any is [Machine.Any]. Any1 is [Machine.Any1]. BindHandlers is [Machine.BindHandlers]. BindTracer is [Machine.BindTracer]. CanAdd is [Machine.CanAdd]. CanAdd1 is [Machine.CanAdd1]. CanRemove is [Machine.CanRemove]. CanRemove1 is [Machine.CanRemove1]. Clock is [Machine.Clock]. Ctx is [Machine.Ctx]. DetachHandlers is [Machine.DetachHandlers]. DetachTracer is [Machine.DetachTracer]. Dispose is [Machine.Dispose]. Err is [Machine.Err]. EvAdd is [Machine.EvAdd]. EvAdd1 is [Machine.EvAdd1]. EvAddErr is [Machine.EvAddErr]. EvAddErrState is [Machine.EvAddErrState]. EvRemove is [Machine.EvRemove]. EvRemove1 is [Machine.EvRemove1]. EvToggle is [Machine.Toggle]. EvToggle1 is [Machine.Toggle1]. Export is [Machine.Export]. Groups is [Machine.Groups]. Has is [Machine.Has]. Has1 is [Machine.Has1]. HasHandlers is [Machine.HasHandlers]. Id is [Machine.Id]. Index is [Machine.Index]. Index1 is [Machine.Index1]. Inspect is [Machine.Inspect]. Is is [Machine.Is]. Is1 is [Machine.Is1]. IsClock is [Machine.IsClock]. IsDisposed is [Machine.IsDisposed]. IsErr is [Machine.IsErr]. IsTime is [Machine.IsTime]. Log is [Machine.Log]. MachineTick is [Machine.MachineTick]. NewStateCtx is [Machine.NewStateCtx]. Not is [Machine.Not]. Not1 is [Machine.Not1]. OnDispose is [Machine.OnDispose]. ParentId is [Machine.ParentId]. ParseStates is [Machine.ParseStates]. QueueLen is [Machine.QueueLen]. QueueTick is [Machine.QueueTick]. Remove is [Machine.Remove]. Remove1 is [Machine.Remove1]. Schema is [Machine.Schema]. SemLogger is [Machine.SemLogger]. Set is [Machine.Set]. StateNames is [Machine.StateNames]. StateNamesMatch is [Machine.StateNamesMatch]. StatesVerified is [Machine.StatesVerified]. String is [Machine.String]. StringAll is [Machine.StringAll]. Switch is [Machine.Switch]. Tags is [Machine.Tags]. Tick is [Machine.Tick]. Time is [Machine.Time]. Toggle is [Machine.Toggle]. Toggle1 is [Machine.Toggle1]. Tracers is [Machine.Tracers]. Transition is [Machine.Transition]. WasClock is [Machine.WasClock]. WasTime is [Machine.WasTime]. When is [Machine.When]. When1 is [Machine.When1]. WhenArgs is [Machine.WhenArgs]. WhenDisposed is [Machine.WhenDisposed]. WhenErr is [Machine.WhenErr]. WhenNot is [Machine.WhenNot]. WhenNot1 is [Machine.WhenNot1]. WhenQuery is [Machine.WhenQuery]. WhenQueue is [Machine.WhenQueue]. WhenTicks is [Machine.WhenTicks]. WhenTime is [Machine.WhenTime]. WhenTime1 is [Machine.WhenTime1]. *Machine *github.com/pancsta/asyncmachine-go/pkg/rpc.NetworkMachine Api : expvar.Var Api : fmt.Stringer func github.com/pancsta/asyncmachine-go/pkg/history.(*BaseMemory).Machine() Api func github.com/pancsta/asyncmachine-go/pkg/history.(*Memory).Machine() Api func github.com/pancsta/asyncmachine-go/pkg/history.MemoryApi.Machine() Api func github.com/pancsta/asyncmachine-go/pkg/history/bbolt.(*Memory).Machine() Api func github.com/pancsta/asyncmachine-go/pkg/history/gorm.(*Memory).Machine() Api func NewCommon(ctx context.Context, id string, stateSchema Schema, stateNames S, handlers any, parent Api, opts *Opts) (*Machine, error) func NewEvent(mach *Machine, machApi Api) *Event func NewSubscriptionManager(mach Api, clock Clock, is, not InternalCheckFunc, log InternalLogFunc) *Subscriptions func Tracer.MachineInit(machine Api) context.Context func Tracer.MutationQueued(machine Api, mutation *Mutation) func Tracer.NewSubmachine(parent, machine Api) func Tracer.QueueEnd(machine Api) func Tracer.SchemaChange(machine Api, old Schema) func Tracer.VerifyStates(machine Api) func (*TracerNoOp).MachineInit(machine Api) context.Context func (*TracerNoOp).MutationQueued(machine Api, mutation *Mutation) func (*TracerNoOp).NewSubmachine(parent, machine Api) func (*TracerNoOp).QueueEnd(machine Api) func (*TracerNoOp).SchemaChange(machine Api, old Schema) func (*TracerNoOp).VerifyStates(machine Api) func github.com/pancsta/asyncmachine-go/pkg/helpers.Add1Async(ctx context.Context, mach Api, waitState string, addState string, args A) Result func github.com/pancsta/asyncmachine-go/pkg/helpers.Add1Block(ctx context.Context, mach Api, state string, args A) Result func github.com/pancsta/asyncmachine-go/pkg/helpers.Add1Sync(ctx context.Context, mach Api, state string, args A) Result func github.com/pancsta/asyncmachine-go/pkg/helpers.AskAdd(mach Api, states S, args A) Result func github.com/pancsta/asyncmachine-go/pkg/helpers.AskAdd1(mach Api, state string, args A) Result func github.com/pancsta/asyncmachine-go/pkg/helpers.AskEvAdd(e *Event, mach Api, states S, args A) Result func github.com/pancsta/asyncmachine-go/pkg/helpers.AskEvAdd1(e *Event, mach Api, state string, args A) Result func github.com/pancsta/asyncmachine-go/pkg/helpers.AskEvRemove(e *Event, mach Api, states S, args A) Result func github.com/pancsta/asyncmachine-go/pkg/helpers.AskEvRemove1(e *Event, mach Api, state string, args A) Result func github.com/pancsta/asyncmachine-go/pkg/helpers.AskRemove(mach Api, states S, args A) Result func github.com/pancsta/asyncmachine-go/pkg/helpers.AskRemove1(mach Api, state string, args A) Result func github.com/pancsta/asyncmachine-go/pkg/helpers.CantAdd(mach Api, states S, args A) bool func github.com/pancsta/asyncmachine-go/pkg/helpers.CantAdd1(mach Api, state string, args A) bool func github.com/pancsta/asyncmachine-go/pkg/helpers.CantRemove(mach Api, states S, args A) bool func github.com/pancsta/asyncmachine-go/pkg/helpers.CantRemove1(mach Api, state string, args A) bool func github.com/pancsta/asyncmachine-go/pkg/helpers.Dispose(mach Api) func github.com/pancsta/asyncmachine-go/pkg/helpers.DisposeBind(mach Api, handler HandlerDispose) func github.com/pancsta/asyncmachine-go/pkg/helpers.GroupWhen1(machs []Api, state string, ctx context.Context) ([]<-chan struct{}, error) func github.com/pancsta/asyncmachine-go/pkg/helpers.Healthcheck(mach Api) func github.com/pancsta/asyncmachine-go/pkg/helpers.IsMulti(mach Api, state string) bool func github.com/pancsta/asyncmachine-go/pkg/helpers.MachDebug(mach Api, amDbgAddr string, logLvl LogLevel, stdout bool, semConfig *SemConfig) error func github.com/pancsta/asyncmachine-go/pkg/helpers.MachDebugEnv(mach Api) error func github.com/pancsta/asyncmachine-go/pkg/helpers.NewMutRequest(mach Api, mutType MutationType, states S, args A) *helpers.MutRequest func github.com/pancsta/asyncmachine-go/pkg/helpers.NewReqAdd(mach Api, states S, args A) *helpers.MutRequest func github.com/pancsta/asyncmachine-go/pkg/helpers.NewReqAdd1(mach Api, state string, args A) *helpers.MutRequest func github.com/pancsta/asyncmachine-go/pkg/helpers.NewReqRemove(mach Api, states S, args A) *helpers.MutRequest func github.com/pancsta/asyncmachine-go/pkg/helpers.NewReqRemove1(mach Api, state string, args A) *helpers.MutRequest func github.com/pancsta/asyncmachine-go/pkg/helpers.RemoveMulti(mach Api, state string) HandlerFinal func github.com/pancsta/asyncmachine-go/pkg/helpers.WaitForErrAll(ctx context.Context, timeout time.Duration, mach Api, chans ...<-chan struct{}) error func github.com/pancsta/asyncmachine-go/pkg/helpers.Cond.Check(mach Api) bool func github.com/pancsta/asyncmachine-go/pkg/helpers.(*MutRequest).Clone(mach Api, mutType MutationType, states S, args A) *helpers.MutRequest func github.com/pancsta/asyncmachine-go/pkg/helpers/testing.AssertErr(t *stdtest.T, mach Api) func github.com/pancsta/asyncmachine-go/pkg/helpers/testing.AssertIs(t *stdtest.T, mach Api, states S) func github.com/pancsta/asyncmachine-go/pkg/helpers/testing.AssertIs1(t *stdtest.T, mach Api, state string) func github.com/pancsta/asyncmachine-go/pkg/helpers/testing.AssertNoErrEver(t *stdtest.T, mach Api) func github.com/pancsta/asyncmachine-go/pkg/helpers/testing.AssertNoErrNow(t *stdtest.T, mach Api) func github.com/pancsta/asyncmachine-go/pkg/helpers/testing.AssertNot(t *stdtest.T, mach Api, states S) func github.com/pancsta/asyncmachine-go/pkg/helpers/testing.AssertNot1(t *stdtest.T, mach Api, state string) func github.com/pancsta/asyncmachine-go/pkg/helpers/testing.GroupWhen1(t *stdtest.T, mach []Api, state string, ctx context.Context) []<-chan struct{} func github.com/pancsta/asyncmachine-go/pkg/helpers/testing.MachDebug(t *stdtest.T, mach Api, amDbgAddr string, logLvl LogLevel, stdout bool) func github.com/pancsta/asyncmachine-go/pkg/helpers/testing.MachDebugEnv(t *stdtest.T, mach Api) func github.com/pancsta/asyncmachine-go/pkg/helpers/testing.WaitForErrAll(t *stdtest.T, source string, ctx context.Context, mach Api, timeout time.Duration, chans ...<-chan struct{}) func github.com/pancsta/asyncmachine-go/pkg/history.NewBaseMemory(ctx context.Context, mach Api, config history.BaseConfig, memImpl history.MemoryApi) *history.BaseMemory func github.com/pancsta/asyncmachine-go/pkg/history.NewMemory(ctx context.Context, machRecord *history.MachineRecord, mach Api, config history.BaseConfig, onErr func(err error)) (*history.Memory, error) func github.com/pancsta/asyncmachine-go/pkg/history/bbolt.NewMemory(ctx context.Context, db *bbolt.DB, mach Api, cfg bbolt.Config, onErr func(err error)) (*bbolt.Memory, error) func github.com/pancsta/asyncmachine-go/pkg/history/gorm.NewMemory(ctx context.Context, db *gorm.DB, mach Api, cfg gorm.Config, onErr func(err error)) (*gorm.Memory, error) func github.com/pancsta/asyncmachine-go/pkg/integrations.HandlerGetter(ctx context.Context, mach Api, req *integrations.GetterReq) (*integrations.GetterResp, error) func github.com/pancsta/asyncmachine-go/pkg/integrations.HandlerMutation(ctx context.Context, mach Api, req *integrations.MutationReq) (*integrations.MutationResp, error) func github.com/pancsta/asyncmachine-go/pkg/integrations.HandlerWaiting(ctx context.Context, mach Api, req *integrations.WaitingReq) (*integrations.WaitingResp, error) func github.com/pancsta/asyncmachine-go/pkg/integrations/nats.ExposeMachine(ctx context.Context, mach Api, nc *nats.Conn, topic, queue string) error func github.com/pancsta/asyncmachine-go/pkg/rpc.MachRepl(mach Api, addr string, opts *rpc.ReplOpts) error func github.com/pancsta/asyncmachine-go/pkg/rpc.MachReplEnv(mach Api) (error, <-chan error) func github.com/pancsta/asyncmachine-go/pkg/rpc.NewServer(ctx context.Context, addr string, name string, netSrcMach Api, opts *rpc.ServerOpts) (*rpc.Server, error) func github.com/pancsta/asyncmachine-go/pkg/states/pipes.Add(source, target Api, sourceState string, targetState string) HandlerFinal func github.com/pancsta/asyncmachine-go/pkg/states/pipes.AddFlat(source, target Api, sourceState string, targetState string) HandlerFinal func github.com/pancsta/asyncmachine-go/pkg/states/pipes.Bind(source, target Api, state string, activeState, inactiveState string) error func github.com/pancsta/asyncmachine-go/pkg/states/pipes.BindAny(source, target Api) error func github.com/pancsta/asyncmachine-go/pkg/states/pipes.BindConnected(source, target Api, disconnected, connecting, connected, disconnecting string) error func github.com/pancsta/asyncmachine-go/pkg/states/pipes.BindErr(source, target Api, targetErr string) error func github.com/pancsta/asyncmachine-go/pkg/states/pipes.BindMany(source, target Api, states, targetStates S) error func github.com/pancsta/asyncmachine-go/pkg/states/pipes.BindReady(source, target Api, activeState, inactiveState string) error func github.com/pancsta/asyncmachine-go/pkg/states/pipes.BindStart(source, target Api, activeState, inactiveState string) error func github.com/pancsta/asyncmachine-go/pkg/states/pipes.Remove(source, target Api, sourceState string, targetState string) HandlerFinal func github.com/pancsta/asyncmachine-go/pkg/states/pipes.RemoveFlat(source, target Api, sourceState string, targetState string) HandlerFinal func github.com/pancsta/asyncmachine-go/pkg/telemetry.BindLokiEnv(mach Api) error func github.com/pancsta/asyncmachine-go/pkg/telemetry.BindLokiLogger(mach Api, client promtail.Client) func github.com/pancsta/asyncmachine-go/pkg/telemetry.BindOtelLogger(mach Api, provider *ologsdk.LoggerProvider, service string) func github.com/pancsta/asyncmachine-go/pkg/telemetry.MachBindOtelEnv(mach Api) error func github.com/pancsta/asyncmachine-go/pkg/telemetry.NewDbgTracer(mach Api, addr string) *telemetry.DbgTracer func github.com/pancsta/asyncmachine-go/pkg/telemetry.NewOtelMachTracer(rootMach Api, rootSpan trace.Span, otelTracer trace.Tracer, opts *telemetry.OtelMachTracerOpts) *telemetry.OtelMachTracer func github.com/pancsta/asyncmachine-go/pkg/telemetry.TransitionsToDbg(mach Api, addr string) error func github.com/pancsta/asyncmachine-go/pkg/telemetry.(*DbgTracer).MachineInit(mach Api) context.Context func github.com/pancsta/asyncmachine-go/pkg/telemetry.(*DbgTracer).MutationQueued(mach Api, mut *Mutation) func github.com/pancsta/asyncmachine-go/pkg/telemetry.(*DbgTracer).SchemaChange(mach Api, _ Schema) func github.com/pancsta/asyncmachine-go/pkg/telemetry.(*OtelMachTracer).MachineInit(mach Api) context.Context func github.com/pancsta/asyncmachine-go/pkg/telemetry.(*OtelMachTracer).NewSubmachine(parent, mach Api) func github.com/pancsta/asyncmachine-go/pkg/telemetry.(*OtelMachTracer).QueueEnd(mach Api) func github.com/pancsta/asyncmachine-go/pkg/telemetry/prometheus.BindMach(mach Api) *prometheus.Metrics func github.com/pancsta/asyncmachine-go/pkg/telemetry/prometheus.MachMetricsEnv(mach Api) *prometheus.Metrics func github.com/pancsta/asyncmachine-go/pkg/telemetry/prometheus.(*PromTracer).NewSubmachine(parent, mach Api) func github.com/pancsta/asyncmachine-go/pkg/telemetry/prometheus.(*PromTracer).SchemaChange(machine Api, old Schema) func github.com/pancsta/asyncmachine-go/pkg/x/history/frostdb.(*Tracer).MachineInit(mach Api) context.Context func github.com/pancsta/asyncmachine-go/tools/generator.(*SyncTracer).MachineInit(mach Api) context.Context func github.com/pancsta/asyncmachine-go/tools/generator.(*SyncTracer).NewSubmachine(parent, mach Api)
AT represents typed arguments of pkg/machine, extracted from Event.Args via ParseArgs, or created manually to for Pass. CalledStates S MutDone chan gets closed by the machine once it's processed. Can cause chan leaks when misused. Only for Can* checks. Err error ErrTrace string Event *Event Panic *ExceptionArgsPanic TargetStates S TimeAfter Time TimeBefore Time func ParseArgs(args A) *AT func Pass(args *AT) A func PassMerge(existing A, args *AT) A
Was the mutation canceled? TODO close these on dispose and deadline
Clock is a map of state names to their tick values. It's like [Time] but indexed by string, instead of int. See [TimeIndex] for a more advanced data structure. func Api.Clock(states S) Clock func (*Machine).Clock(states S) Clock func (*Transition).ClockAfter() Clock func (*Transition).ClockBefore() Clock func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).Clock(states S) Clock func MockClock(mach *Machine, clock Clock) func NewSubscriptionManager(mach Api, clock Clock, is, not InternalCheckFunc, log InternalLogFunc) *Subscriptions func Api.IsClock(clock Clock) bool func Api.WasClock(clock Clock) bool func (*Machine).IsClock(clock Clock) bool func (*Machine).WasClock(clock Clock) bool func (*Subscriptions).ProcessWhenTime(before Clock) []chan struct{} func (*Subscriptions).SetClock(clock Clock) func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).IsClock(clock Clock) bool func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).WasClock(clock Clock) bool
Cancel context.CancelFunc Ctx context.Context
var CtxKey *CtxKeyName
Id string State string Tick uint64
DefaultRelationsResolver is the default implementation of the RelationsResolver with Add, Remove, Require and After. It can be overridden using Opts.Resolver. TODO refac RelationsDefault Index S TODO replace with TimeIndex, log(), Schema - for netmach mut filtering - for alternative impls Transition *Transition InboundRelationsOf returns a list of states pointing to [toState]. Not thread safe. NewAutoMutation implements RelationsResolver.GetAutoMutation. (*DefaultRelationsResolver) NewSchema(schema Schema, states S) RelationsBetween returns a list of outbound relations between fromState -> toState. Not thread safe. RelationsOf returns a list of relation types of the given state. Not thread safe. SortStates implements RelationsResolver.SortStates. TargetStates implements RelationsResolver.TargetStates. *DefaultRelationsResolver : RelationsResolver
Event struct represents a single event of a Mutation within a Transition. One event can have 0-n handlers. Args is a map of named arguments for a Mutation. Ctx is an optional context this event is constrained by. IsCheck is true if this event is a check event, fired by one of Can*() methods. Useful for avoiding flooding the log with errors. MachineId is the ID of the parent machine. Name of the handler method (eg FooState). TransitionId is the ID of the parent transition. Clone clones the event struct, making it writable. Export clones only the essential data of the Event. Useful for tracing vs GC. IsValid confirm this event should still be processed. Useful for negotiation handlers, which can't use state context. (*Event) Machine() *Machine Mutation returns the Mutation of an Event. (*Event) String() string SwapArgs clone the event and assign new args. Transition returns the Transition of an Event. *Event : database/sql/driver.Validator *Event : expvar.Var *Event : fmt.Stringer func NewEvent(mach *Machine, machApi Api) *Event func (*Event).Clone() *Event func (*Event).Export() *Event func (*Event).SwapArgs(args A) *Event func Api.EvAdd(event *Event, states S, args A) Result func Api.EvAdd1(event *Event, state string, args A) Result func Api.EvAddErr(event *Event, err error, args A) Result func Api.EvAddErrState(event *Event, state string, err error, args A) Result func Api.EvRemove(event *Event, states S, args A) Result func Api.EvRemove1(event *Event, state string, args A) Result func Api.EvToggle(event *Event, states S, args A) Result func Api.EvToggle1(event *Event, state string, args A) Result func (*ExceptionHandler).ExceptionState(e *Event) func (*Machine).EvAdd(event *Event, states S, args A) Result func (*Machine).EvAdd1(event *Event, state string, args A) Result func (*Machine).EvAddErr(event *Event, err error, args A) Result func (*Machine).EvAddErrState(event *Event, state string, err error, args A) Result func (*Machine).EvRemove(event *Event, states S, args A) Result func (*Machine).EvRemove1(event *Event, state string, args A) Result func (*Machine).EvToggle(e *Event, states S, args A) Result func (*Machine).EvToggle1(e *Event, state string, args A) Result func (*Subscriptions).ProcessWhenArgs(e *Event) []chan struct{} func github.com/pancsta/asyncmachine-go/pkg/helpers.AskEvAdd(e *Event, mach Api, states S, args A) Result func github.com/pancsta/asyncmachine-go/pkg/helpers.AskEvAdd1(e *Event, mach Api, state string, args A) Result func github.com/pancsta/asyncmachine-go/pkg/helpers.AskEvRemove(e *Event, mach Api, states S, args A) Result func github.com/pancsta/asyncmachine-go/pkg/helpers.AskEvRemove1(e *Event, mach Api, state string, args A) Result func github.com/pancsta/asyncmachine-go/pkg/node.AddErrWorker(event *Event, mach *Machine, err error, args A) error func github.com/pancsta/asyncmachine-go/pkg/node.(*Client).StartEnd(e *Event) func github.com/pancsta/asyncmachine-go/pkg/node.(*Client).StartEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/node.(*Client).StartState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/node.(*Client).WorkerPayloadEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/node.(*Client).WorkerPayloadState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/node.(*Client).WorkerRequestedEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/node.(*Client).WorkerRequestedState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/node.(*Supervisor).ClientConnectedState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/node.(*Supervisor).ClientDisconnectedEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/node.(*Supervisor).ClientDisconnectedState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/node.(*Supervisor).ErrWorkerState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/node.(*Supervisor).ForkingWorkerEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/node.(*Supervisor).ForkingWorkerState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/node.(*Supervisor).ForkWorkerEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/node.(*Supervisor).ForkWorkerState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/node.(*Supervisor).HeartbeatState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/node.(*Supervisor).KillingWorkerEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/node.(*Supervisor).KillingWorkerState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/node.(*Supervisor).ListWorkersEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/node.(*Supervisor).ListWorkersState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/node.(*Supervisor).NormalizingPoolState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/node.(*Supervisor).PoolReadyEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/node.(*Supervisor).PoolReadyExit(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/node.(*Supervisor).ProvideWorkerEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/node.(*Supervisor).ProvideWorkerState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/node.(*Supervisor).SetWorkerEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/node.(*Supervisor).SetWorkerState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/node.(*Supervisor).StartEnd(e *Event) func github.com/pancsta/asyncmachine-go/pkg/node.(*Supervisor).StartEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/node.(*Supervisor).StartState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/node.(*Supervisor).WorkerConnectedEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/node.(*Supervisor).WorkerConnectedState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/node.(*Supervisor).WorkerForkedEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/node.(*Supervisor).WorkerForkedState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/node.(*Supervisor).WorkerKilledEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/node.(*Supervisor).WorkerKilledState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/node.(*Worker).ErrNetworkState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/node.(*Worker).HealthcheckState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/node.(*Worker).LocalRpcReadyState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/node.(*Worker).PublicRpcReadyState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/node.(*Worker).RpcReadyState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/node.(*Worker).SendPayloadEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/node.(*Worker).ServeClientEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/node.(*Worker).ServeClientState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/node.(*Worker).StartEnd(e *Event) func github.com/pancsta/asyncmachine-go/pkg/node.(*Worker).StartEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/node.(*Worker).StartState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/pubsub.AddErrJoining(event *Event, mach *Machine, err error, args A) error func github.com/pancsta/asyncmachine-go/pkg/pubsub.AddErrListening(event *Event, mach *Machine, err error, args A) error func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Topic).ConnectingEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Topic).ConnectingState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Topic).DoSendInfoEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Topic).DoSendInfoState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Topic).ExceptionEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Topic).ExceptionState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Topic).HeartbeatState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Topic).JoinedEnd(e *Event) func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Topic).JoinedState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Topic).JoiningState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Topic).ListMachinesEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Topic).ListMachinesState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Topic).MissPeersByGossipEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Topic).MissPeersByGossipExit(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Topic).MissPeersByGossipState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Topic).MissPeersByUpdatesEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Topic).MissPeersByUpdatesExit(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Topic).MissPeersByUpdatesState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Topic).MissUpdatesByGossipEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Topic).MissUpdatesByGossipExit(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Topic).MissUpdatesByGossipState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Topic).MsgByeEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Topic).MsgInfoEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Topic).MsgInfoState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Topic).MsgReceivedEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Topic).MsgReqInfoEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Topic).MsgReqInfoState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Topic).MsgReqUpdatesEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Topic).MsgReqUpdatesState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Topic).MsgUpdatesEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Topic).MsgUpdatesState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Topic).PeerJoinedEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Topic).PeerJoinedState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Topic).PeerLeftEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Topic).ProcessMsgsState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Topic).ReadyEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Topic).ReqMissingPeersEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Topic).ReqMissingPeersState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Topic).ReqMissingUpdatesEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Topic).ReqMissingUpdatesState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Topic).SendGossipsEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Topic).SendGossipsState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Topic).SendInfoEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Topic).SendInfoState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Topic).SendMsgEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Topic).SendMsgState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Topic).SendUpdatesEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Topic).SendUpdatesState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Topic).StartEnd(e *Event) func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Topic).StartEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Topic).StartState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/rpc.AddErr(e *Event, mach *Machine, msg string, err error) func github.com/pancsta/asyncmachine-go/pkg/rpc.AddErrNetwork(e *Event, mach *Machine, err error) func github.com/pancsta/asyncmachine-go/pkg/rpc.AddErrNoConn(e *Event, mach *Machine, err error) func github.com/pancsta/asyncmachine-go/pkg/rpc.AddErrParams(e *Event, mach *Machine, err error) func github.com/pancsta/asyncmachine-go/pkg/rpc.AddErrResp(e *Event, mach *Machine, err error) func github.com/pancsta/asyncmachine-go/pkg/rpc.AddErrRpcStr(e *Event, mach *Machine, msg string) func github.com/pancsta/asyncmachine-go/pkg/rpc.(*Client).CallRetryFailedState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/rpc.(*Client).ConnectedState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/rpc.(*Client).ConnectingState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/rpc.(*Client).DisconnectedEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/rpc.(*Client).DisconnectedState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/rpc.(*Client).DisconnectingEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/rpc.(*Client).DisconnectingState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/rpc.(*Client).ExceptionState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/rpc.(*Client).HandshakeDoneEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/rpc.(*Client).HandshakeDoneState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/rpc.(*Client).HandshakingState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/rpc.(*Client).HealthcheckState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/rpc.(*Client).RetryingCallEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/rpc.(*Client).RetryingConnState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/rpc.(*Client).StartEnd(e *Event) func github.com/pancsta/asyncmachine-go/pkg/rpc.(*Client).StartState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/rpc.(*Client).WorkerPayloadEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/rpc.(*Client).WorkerPayloadState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/rpc.(*ExceptionHandler).ExceptionEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/rpc.(*Mux).ClientConnectedState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/rpc.(*Mux).ExceptionState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/rpc.(*Mux).HasClientsEnd(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/rpc.(*Mux).HealthcheckState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/rpc.(*Mux).NewServerErrEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/rpc.(*Mux).NewServerErrState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/rpc.(*Mux).StartEnd(e *Event) func github.com/pancsta/asyncmachine-go/pkg/rpc.(*Mux).StartEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/rpc.(*Mux).StartState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).EvAdd(event *Event, states S, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).EvAdd1(event *Event, state string, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).EvAddErr(event *Event, err error, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).EvAddErrState(event *Event, state string, err error, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).EvRemove(event *Event, states S, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).EvRemove1(event *Event, state string, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).EvToggle(e *Event, states S, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).EvToggle1(e *Event, state string, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*Server).HandshakeDoneEnd(e *Event) func github.com/pancsta/asyncmachine-go/pkg/rpc.(*Server).RpcReadyEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/rpc.(*Server).RpcReadyState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/rpc.(*Server).RpcStartingEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/rpc.(*Server).RpcStartingState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/rpc.(*Server).SendPayload(ctx context.Context, event *Event, payload *rpc.MsgSrvPayload) error func github.com/pancsta/asyncmachine-go/pkg/rpc.(*Server).StartEnd(e *Event) func github.com/pancsta/asyncmachine-go/pkg/rpc/states.ConsumerHandlers.WorkerPayloadState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/states.AddErrConnecting(event *Event, mach *Machine, err error, args A) error func github.com/pancsta/asyncmachine-go/pkg/states.(*DisposedHandlers).DisposedState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/states.(*DisposedHandlers).DisposingState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/states.(*DisposedHandlers).RegisterDisposalEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/pkg/states.(*DisposedHandlers).RegisterDisposalState(e *Event) func github.com/pancsta/asyncmachine-go/pkg/x/helpers.NestedState(e *Event, strIDField string, machGetter func(id string) *Machine) (Result, <-chan struct{}, error) func github.com/pancsta/asyncmachine-go/examples/benchmark_grpc.(*WorkerArpcServer).CallOpEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/examples/benchmark_grpc.(*WorkerArpcServer).CallOpState(e *Event) func github.com/pancsta/asyncmachine-go/examples/benchmark_grpc.(*WorkerArpcServer).EventState(_ *Event) func github.com/pancsta/asyncmachine-go/examples/benchmark_grpc.(*WorkerArpcServer).StartState(_ *Event) func github.com/pancsta/asyncmachine-go/examples/mach_template.AddErrExample(event *Event, mach *Machine, err error, args A) error func github.com/pancsta/asyncmachine-go/examples/mach_template.(*TemplateHandlers).BarExit(e *Event) bool func github.com/pancsta/asyncmachine-go/examples/mach_template.(*TemplateHandlers).BazDoneState(e *Event) func github.com/pancsta/asyncmachine-go/examples/mach_template.(*TemplateHandlers).BazState(e *Event) func github.com/pancsta/asyncmachine-go/examples/mach_template.(*TemplateHandlers).ChannelEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/examples/mach_template.(*TemplateHandlers).ChannelState(e *Event) func github.com/pancsta/asyncmachine-go/examples/mach_template.(*TemplateHandlers).FooState(e *Event) func github.com/pancsta/asyncmachine-go/examples/path_watcher.(*PathWatcher).AllRefreshedEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/examples/path_watcher.(*PathWatcher).AllRefreshedState(e *Event) func github.com/pancsta/asyncmachine-go/examples/path_watcher.(*PathWatcher).ChangeEventState(e *Event) func github.com/pancsta/asyncmachine-go/examples/path_watcher.(*PathWatcher).ExceptionState(e *Event) func github.com/pancsta/asyncmachine-go/examples/path_watcher.(*PathWatcher).InitEnd(e *Event) func github.com/pancsta/asyncmachine-go/examples/path_watcher.(*PathWatcher).InitState(e *Event) func github.com/pancsta/asyncmachine-go/examples/path_watcher.(*PathWatcher).RefreshedEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/examples/path_watcher.(*PathWatcher).RefreshedState(e *Event) func github.com/pancsta/asyncmachine-go/examples/path_watcher.(*PathWatcher).RefreshingEnd(e *Event) func github.com/pancsta/asyncmachine-go/examples/path_watcher.(*PathWatcher).RefreshingEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/examples/path_watcher.(*PathWatcher).RefreshingExit(e *Event) bool func github.com/pancsta/asyncmachine-go/examples/path_watcher.(*PathWatcher).RefreshingState(e *Event) func github.com/pancsta/asyncmachine-go/examples/path_watcher.(*PathWatcher).WatchingEnd(e *Event) func github.com/pancsta/asyncmachine-go/examples/path_watcher.(*PathWatcher).WatchingState(e *Event) func github.com/pancsta/asyncmachine-go/examples/raw_strings.(*Handlers).ProcessingFileEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/examples/raw_strings.(*Handlers).ProcessingFileState(e *Event) func github.com/pancsta/asyncmachine-go/examples/temporal_fileprocessing.(*MachineHandlers).DownloadingFileState(e *Event) func github.com/pancsta/asyncmachine-go/examples/temporal_fileprocessing.(*MachineHandlers).ProcessingFileEnd(e *Event) func github.com/pancsta/asyncmachine-go/examples/temporal_fileprocessing.(*MachineHandlers).ProcessingFileState(e *Event) func github.com/pancsta/asyncmachine-go/examples/temporal_fileprocessing.(*MachineHandlers).UploadingFileEnd(e *Event) func github.com/pancsta/asyncmachine-go/examples/temporal_fileprocessing.(*MachineHandlers).UploadingFileState(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).AddressFocusedEnd(_ *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).AddressFocusedState(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).AfterFocusEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).AfterFocusState(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).AnyEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).AnyState(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).BackEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).BackState(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).BackStepEnter(_ *Event) bool func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).BackStepState(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).BuildingLogEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).BuildingLogState(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).ClientListVisibleEnd(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).ClientListVisibleState(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).ClientMsgEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).ClientMsgState(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).ClientSelectedEnd(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).ClientSelectedState(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).ConnectEventEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).ConnectEventState(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).DiagramsReadyState(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).DiagramsRenderingEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).DiagramsRenderingState(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).DiagramsScheduledEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).DiagramsScheduledState(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).DisconnectEventEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).DisconnectEventState(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).ExceptionEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).ExceptionState(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).ExportDialogEnd(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).ExportDialogState(_ *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).FilterCanceledTxEnd(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).FilterQueuedTxEnd(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).FwdEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).FwdState(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).FwdStepEnter(_ *Event) bool func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).FwdStepState(_ *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).GcMsgsEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).GcMsgsState(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).HeartbeatState(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).HelpDialogEnd(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).HelpDialogState(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).LogBuiltState(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).LogReaderVisibleEnd(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).LogReaderVisibleState(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).LogUpdatedState(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).MatrixRainEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).MatrixRainSelectedState(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).MatrixRainState(_ *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).MatrixViewEnd(_ *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).MatrixViewState(_ *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).NarrowLayoutEnd(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).NarrowLayoutExit(e *Event) bool func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).NarrowLayoutState(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).PausedState(_ *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).PlayingEnd(_ *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).PlayingState(_ *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).ReadyEnd(_ *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).ReadyState(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).RedrawState(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).RemoveClientEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).RemoveClientState(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).ResizedState(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).ScrollToMutTxState(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).ScrollToStepEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).ScrollToStepState(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).ScrollToTxEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).ScrollToTxState(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).SelectingClientEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).SelectingClientState(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).SetCursorEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).SetCursorState(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).SetGroupEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).SetGroupState(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).StartEnd(_ *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).StartState(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).StateNameSelectedEnd(_ *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).StateNameSelectedEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).StateNameSelectedState(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).SwitchedClientTxState(_ *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).SwitchingClientTxState(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).TailModeEnd(_ *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).TailModeState(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).TimelineStepsFocusedEnd(_ *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).TimelineStepsFocusedState(_ *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).TimelineStepsHiddenEnd(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).TimelineStepsHiddenState(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).TimelineStepsScrolledEnd(_ *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).TimelineStepsScrolledState(_ *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).TimelineTxHiddenEnd(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).TimelineTxHiddenState(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).ToggleToolEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).ToggleToolState(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).Toolbar1FocusedEnd(_ *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).Toolbar1FocusedState(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).Toolbar2FocusedEnd(_ *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).Toolbar2FocusedState(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).Toolbar3FocusedEnd(_ *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).Toolbar3FocusedState(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).ToolRainState(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).ToolToggledState(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).TreeGroupsFocusedEnd(_ *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).TreeGroupsFocusedState(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).TreeMatrixViewEnd(_ *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).TreeMatrixViewState(_ *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).UpdateFocusState(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).UpdateLogScheduledState(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).UpdatingLogState(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).UserBackState(_ *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).UserBackStepState(_ *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).UserFwdState(_ *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).UserFwdStepState(_ *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).WebReqState(e *Event) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).WebSocketState(e *Event) func github.com/pancsta/asyncmachine-go/tools/generator.(*SchemaGenerator).GroupsEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/tools/generator.(*SchemaGenerator).InheritEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/tools/relay.(*Relay).ClientMsgEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/tools/relay.(*Relay).ClientMsgState(e *Event) func github.com/pancsta/asyncmachine-go/tools/relay.(*Relay).ConnectEventEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/tools/relay.(*Relay).ConnectEventState(e *Event) func github.com/pancsta/asyncmachine-go/tools/relay.(*Relay).DisconnectEventEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/tools/relay.(*Relay).DisconnectEventState(e *Event) func github.com/pancsta/asyncmachine-go/tools/relay.(*Relay).StartState(e *Event) func github.com/pancsta/asyncmachine-go/tools/repl.AddErrSyntax(event *Event, mach *Machine, err error, args A) error func github.com/pancsta/asyncmachine-go/tools/repl.(*Repl).AddrChangedEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/tools/repl.(*Repl).AddrChangedState(e *Event) func github.com/pancsta/asyncmachine-go/tools/repl.(*Repl).CmdAddEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/tools/repl.(*Repl).CmdAddState(e *Event) func github.com/pancsta/asyncmachine-go/tools/repl.(*Repl).CmdGroupAddEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/tools/repl.(*Repl).CmdGroupAddState(e *Event) func github.com/pancsta/asyncmachine-go/tools/repl.(*Repl).CmdGroupRemoveEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/tools/repl.(*Repl).CmdGroupRemoveState(e *Event) func github.com/pancsta/asyncmachine-go/tools/repl.(*Repl).CmdRemoveEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/tools/repl.(*Repl).CmdRemoveState(e *Event) func github.com/pancsta/asyncmachine-go/tools/repl.(*Repl).ConnectedExit(e *Event) bool func github.com/pancsta/asyncmachine-go/tools/repl.(*Repl).ConnectedFullyEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/tools/repl.(*Repl).ConnectedFullyExit(e *Event) bool func github.com/pancsta/asyncmachine-go/tools/repl.(*Repl).ConnectedState(e *Event) func github.com/pancsta/asyncmachine-go/tools/repl.(*Repl).ConnectingEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/tools/repl.(*Repl).ConnectingExit(e *Event) bool func github.com/pancsta/asyncmachine-go/tools/repl.(*Repl).ConnectingState(e *Event) func github.com/pancsta/asyncmachine-go/tools/repl.(*Repl).DisconnectedState(e *Event) func github.com/pancsta/asyncmachine-go/tools/repl.(*Repl).DisconnectingState(e *Event) func github.com/pancsta/asyncmachine-go/tools/repl.(*Repl).ErrNetworkState(e *Event) func github.com/pancsta/asyncmachine-go/tools/repl.(*Repl).ListMachinesEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/tools/repl.(*Repl).ListMachinesState(e *Event) func github.com/pancsta/asyncmachine-go/tools/repl.(*Repl).ReplModeState(e *Event) func github.com/pancsta/asyncmachine-go/tools/repl.(*Repl).RpcConnEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/tools/repl.(*Repl).RpcConnState(e *Event) func github.com/pancsta/asyncmachine-go/tools/repl.(*Repl).RpcDisconnEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/tools/repl.(*Repl).RpcDisconnState(e *Event) func github.com/pancsta/asyncmachine-go/tools/repl.(*Repl).StartEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/tools/repl.(*Repl).StartState(e *Event) func github.com/pancsta/asyncmachine-go/tools/visualizer.(*Visualizer).ClientMsgEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/tools/visualizer.(*Visualizer).ClientMsgState(e *Event) func github.com/pancsta/asyncmachine-go/tools/visualizer.(*Visualizer).ConnectEventEnter(e *Event) bool func github.com/pancsta/asyncmachine-go/tools/visualizer.(*Visualizer).ConnectEventState(e *Event) func github.com/pancsta/asyncmachine-go/tools/visualizer.(*Visualizer).GoToMachAddrState(e *Event) func github.com/pancsta/asyncmachine-go/tools/visualizer.(*Visualizer).InitClientState(e *Event)
ExceptionArgsPanic is an optional argument ["panic"] for the StateException state which describes a panic within a Transition handler. CalledStates S LastStep *Step StackTrace string StatesBefore S Transition *Transition
ExceptionHandler provide a basic StateException state support, as should be embedded into handler structs in most of the cases. Because ExceptionState will be called after [Machine.HandlerDeadline], it should handle locks on its own (to not race with itself). ExceptionState is a final entry handler for the StateException state. Args: - err error: The error that caused the StateException state. - panic *ExceptionArgsPanic: Optional details about the panic.
func (*Machine).OnChange(fn HandlerChange)
HandlerDispose is a machine disposal handler func signature. func Api.OnDispose(fn HandlerDispose) func (*Machine).OnDispose(fn HandlerDispose) func github.com/pancsta/asyncmachine-go/pkg/helpers.DisposeBind(mach Api, handler HandlerDispose) func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).OnDispose(fn HandlerDispose)
func (*Machine).OnError(fn HandlerError)
HandlerFinal is a final transition handler func signature. func github.com/pancsta/asyncmachine-go/pkg/helpers.RemoveMulti(mach Api, state string) HandlerFinal func github.com/pancsta/asyncmachine-go/pkg/states/pipes.Add(source, target Api, sourceState string, targetState string) HandlerFinal func github.com/pancsta/asyncmachine-go/pkg/states/pipes.AddFlat(source, target Api, sourceState string, targetState string) HandlerFinal func github.com/pancsta/asyncmachine-go/pkg/states/pipes.Remove(source, target Api, sourceState string, targetState string) HandlerFinal func github.com/pancsta/asyncmachine-go/pkg/states/pipes.RemoveFlat(source, target Api, sourceState string, targetState string) HandlerFinal
HandlerNegotiation is a negotiation transition handler func signature.
IndexStateCtx is a map of (single) state names to a context cancel function
IndexWhen is a map of (single) state names to a list of activation or de-activation bindings
IndexWhenArgs is a map of (single) state names to a list of args value bindings
IndexWhenTime is a map of (single) state names to a list of time bindings
func NewSubscriptionManager(mach Api, clock Clock, is, not InternalCheckFunc, log InternalLogFunc) *Subscriptions
func NewSubscriptionManager(mach Api, clock Clock, is, not InternalCheckFunc, log InternalLogFunc) *Subscriptions
TODO add TTL, ctx TracerNoOp *TracerNoOp ( LastTxTracer) HandlerEnd(transition *Transition, emitter string, handler string) ( LastTxTracer) HandlerStart(transition *Transition, emitter string, handler string) ( LastTxTracer) Inheritable() bool Load returns the last transition. ( LastTxTracer) MachineDispose(machID string) ( LastTxTracer) MachineInit(machine Api) context.Context ( LastTxTracer) MutationQueued(machine Api, mutation *Mutation) ( LastTxTracer) NewSubmachine(parent, machine Api) ( LastTxTracer) QueueEnd(machine Api) ( LastTxTracer) SchemaChange(machine Api, old Schema) (*LastTxTracer) String() string (*LastTxTracer) TransitionEnd(transition *Transition) ( LastTxTracer) TransitionInit(transition *Transition) ( LastTxTracer) TransitionStart(transition *Transition) ( LastTxTracer) VerifyStates(machine Api) *LastTxTracer : Tracer *LastTxTracer : expvar.Var *LastTxTracer : fmt.Stringer func NewLastTxTracer() *LastTxTracer
LogArgsMapperFn is a function that maps arguments to be logged. Useful for debugging. See NewArgsMapper. func SemLogger.ArgsMapper() LogArgsMapperFn func (*Mutation).LogArgs(mapper LogArgsMapperFn) string func (*Mutation).MapArgs(mapper LogArgsMapperFn) map[string]string func SemLogger.SetArgsMapper(mapper LogArgsMapperFn)
Level LogLevel Text string
LoggerFn is a logging function for the machine. func SemLogger.Logger() LoggerFn func SemLogger.SetLogger(logger LoggerFn)
LogLevel defines the level of details in the produced log (0-5). ( LogLevel) String() string LogLevel : expvar.Var LogLevel : fmt.Stringer func EnvLogLevel(name string) LogLevel func SemLogger.Level() LogLevel func SemLogger.SetEmpty(lvl LogLevel) func SemLogger.SetLevel(lvl LogLevel) func SemLogger.SetSimple(logf func(format string, args ...any), level LogLevel) func github.com/pancsta/asyncmachine-go/pkg/helpers.MachDebug(mach Api, amDbgAddr string, logLvl LogLevel, stdout bool, semConfig *SemConfig) error func github.com/pancsta/asyncmachine-go/pkg/helpers.SetEnvLogLevel(level LogLevel) func github.com/pancsta/asyncmachine-go/pkg/helpers/testing.MachDebug(t *stdtest.T, mach Api, amDbgAddr string, logLvl LogLevel, stdout bool) func github.com/pancsta/asyncmachine-go/tools/debugger.(*Debugger).SetFilterLogLevel(lvl LogLevel) const LogChanges const LogDecisions const LogEverything const LogExternal const LogNothing const LogOps
Machine provides a state machine API with mutations, state schema, handlers, subscriptions, tracers, and helpers methods. It also holds a queue of mutations to execute. DisposeTimeout specifies the duration to wait for the queue to drain during disposal. Default 1s. EvalTimeout is the time the machine will try to execute an eval func. Like any other handler, eval func also has [HandlerTimeout]. Default: 1s. HandlerBackoff is the time after a [HandlerDeadline], during which the machine will return [Canceled] to any mutation. HandlerDeadline is a grace period after a handler timeout, before the machine moves on. HandlerTimeout defined the time for a handler to execute before it causes StateException. Default: 1s. See also [Opts.HandlerTimeout]. Using HandlerTimeout can cause race conditions, unless paired with [Event.IsValid]. LastHandlerDeadline stores when the last HandlerDeadline was hit. If true, the machine will log stack traces of errors. Default: true. Requires an ExceptionHandler binding and [Machine.PanicToException] set. If true, the machine will catch panic and trigger the [StateException] state. Default: true. Can be disabled via AM_DEBUG=1. Maximum number of mutations that can be queued. Default: 1000. ActiveStates returns a copy of the currently active states when states is nil, optionally limiting the results to a subset of states. Add activates a list of states in the machine, returning the result of the transition (Executed, Queued, Canceled). Like every mutation method, it will resolve relations and trigger handlers. Add1 is a shorthand method to add a single state with the passed args. See Add(). AddBreakpoint adds a breakpoint for an outcome of mutation (added and removed states) checked by mutation equality. Once such a mutation happens, a log message will be printed out. We can set an IDE's breakpoint on this line and see the mutation's sync stack trace. If [Machine.LogStackTrace] is set, the stack trace will be printed out as well. Many breakpoints can be added, but none removed. Breakpoints are useful to find the caller of a mutation, but don't work with [Machine.Set]. strict: strict skips already active / inactive (for strict of diff equality). (*Machine) AddBreakpoint1(added string, removed string, strict bool) AddErr is a dedicated method to add the StateException state with the passed error and optional arguments. Like every mutation method, it will resolve relations and trigger handlers. AddErr produces a stack trace of the error, if LogStackTrace is enabled. AddErrState adds a dedicated error state, along with the build in StateException state. Like every mutation method, it will resolve relations and trigger handlers. AddErrState produces a stack trace of the error, if LogStackTrace is enabled. Any is a group call to Is, returns true if any of the params return true from Is. machine.StringAll() // ()[Foo:0 Bar:0 Baz:0] machine.Add(S{"Foo"}) // is(Foo, Bar) or is(Bar) machine.Any(S{"Foo", "Bar"}, S{"Bar"}) // false // is(Foo) or is(Bar) machine.Any(S{"Foo"}, S{"Bar"}) // true Any1 is group call to [Machine.Is1], returns true if any of the params return true from [Machine.Is1]. Backoff is true in case the machine had a recent HandlerDeadline. During a backoff, all mutations will be [Canceled]. BindHandlers binds a struct of handler methods to machine's states, based on the naming convention, eg `FooState(e *Event)`. Negotiation handlers can optionally return bool. BindTracer binds a Tracer to the machine. Tracers can cause StateException in submachines, before any handlers are bound. Use the Err() getter to examine such errors. CanAdd checks if [states] can be added and returns Executed or [AT.CheckDone] if a dry run mutation passes. Useful for reducing failed negotiations. CanAdd1 is [Machine.CanAdd] for a single state. CanRemove checks if [states] can be removed and returns Executed or [AT.CheckDone] if a dry run mutation passes. Useful for reducing failed negotiations. CanRemove1 is [Machine.CanRemove] for a single state. Clock returns current machine's clock, a state-keyed map of ticks. If states are passed, only the ticks of the passed states are returned. Ctx return machine's root context. DetachHandlers detaches previously bound machine handlers. DetachTracer tries to remove a tracer from the machine. Returns an error in case the tracer wasn't bound. Dispose disposes the machine and all its emitters. You can wait for the completion of the disposal with `<-mach.WhenDisposed`. DisposeForce disposes the machine and all its emitters, without waiting for the queue to drain. Will cause panics. Err returns the last error. EvAdd is like Add, but passed the source event as the 1st param, which results in traceable transitions. EvAdd1 is like Add1 but passed the source event as the 1st param, which results in traceable transitions. EvAddErr is like AddErr, but passed the source event as the 1st param, which results in traceable transitions. EvAddErrState is like AddErrState, but passed the source event as the 1st param, which results in traceable transitions. EvRemove is like Remove but passed the source event as the 1st param, which results in traceable transitions. EvRemove1 is like Remove1, but passed the source event as the 1st param, which results in traceable transitions. EvToggle is a traced version of [Machine.Toggle]. EvToggle1 is a traced version of [Machine.Toggle1]. Eval executes a function on the machine's queue, allowing to avoid using locks for non-handler code. Blocking code should NOT be scheduled here. Eval cannot be called within a handler's critical zone, as both are using the same serial queue and will deadlock. Eval has a timeout of HandlerTimeout/2 and will return false in case it happens. Evals do not trigger consensus, thus are much faster than state mutations. ctx: nil context defaults to machine's context. Note: usage of Eval is discouraged. But if you have to, use AM_DETECT_EVAL in tests for deadlock detection. Most usages of eval can be replaced with atomics or returning from mutation via channels. Export exports the machine state as Serialized: ID, machine time, and state names. (*Machine) Groups() (map[string][]int, []string) Has return true is passed states are registered in the machine. Useful for checking if a machine implements a specific state set. Has1 is shorthand for Has. It returns true if the passed state is registered in the machine. HasHandlers returns true if this machine has bound handlers, and thus an allocated goroutine. It also makes it nondeterministic. Id returns the machine's id. Import imports the machine state from Serialized. It's not safe to import into a machine which has already produces transitions and/or has telemetry connected (use [Machine.SetSchema] instead). Index returns a list of state indexes in the machine's StateNames() list, with -1s for missing ones. Index1 returns the index of a state in the machine's StateNames() list, or -1 when not found or machine has been disposed. Inspect returns a multi-line string representation of the machine (states, relations, clocks). states: param for ordered or partial results. Is checks if all the passed states are currently active. machine.StringAll() // ()[Foo:0 Bar:0 Baz:0] machine.Add(S{"Foo"}) machine.Is(S{"Foo"}) // true machine.Is(S{"Foo", "Bar"}) // false Is1 is [Machine.Is] for a single state. IsClock checks if the machine has changed since the passed clock. Returns true if at least one state has changed. IsDisposed returns true if the machine has been disposed. IsErr checks if the machine has the StateException state currently active. IsQueued checks if a particular mutation has been queued. Returns an index (idx, true), or (0, false), if not found. mutType: add, remove, set states: list of states used in the mutation withoutArgsOnly: matches only mutation without the arguments object statesStrictEqual: states of the mutation have to be exactly like `states` and not a superset. minQueueTick: minimal queue tick assigned to the matched mutation isCheck: the mutation has to be a [Mutation.IsCheck] position: position in the queue, after applying the [startIndex] IsQueuedAbove ... N times. This method allows for rate-limiting of mutations for specific states and a threshold. IsTime checks if the machine has changed since the passed time (list of ticks). Returns true if at least one state has changed. The states param is optional and can be used to check only a subset of states. Log logs an [extern] message unless LogNothing is set. Optionally redirects to a custom logger from SemLogger().SetLogger. MachineTick is the number of times the machine has been started. Each start means an empty queue. Only set by [Machine.Import]. MustBindHandlers is a panicking version of BindHandlers, useful in tests. NewStateCtx returns a new sub-context, bound to the current clock's tick of the passed state. Context cancels when the state has been deactivated, or right away, if it isn't currently active. State contexts are used to check state expirations and should be checked often inside goroutines. Not checks if **none** of the passed states are currently active. machine.StringAll() // -> ()[A:0 B:0 C:0 D:0] machine.Add(S{"A", "B"}) // not(A) and not(C) machine.Not(S{"A", "C"}) // -> false // not(C) and not(D) machine.Not(S{"C", "D"}) // -> true Not1 is [Machine.Not] for a single state. OnChange is the most basic state-change handler, useful for machines without any handlers. OnDispose adds a function to be called after the machine gets disposed. These functions will run synchronously just before WhenDisposed() channel gets closed. Considering it's a low-level feature, it's advised to handle disposal via dedicated states. OnError is the most basic error handler, useful for machines without any handlers. PanicToErr will catch a panic and add the StateException state. Needs to be called in a defer statement, just like a recover() call. PanicToErrState will catch a panic and add the StateException state, along with the passed state. Needs to be called in a defer statement, just like a recover() call. ParentId returns the ID of the parent machine (if any). ParseStates parses a list of states, removing unknown ones and duplicates. Use [Machine.Has] and [Machine.Has1] to check if a state is defined for the machine. PrependMut prepends the mutation to the front of the queue. This is a special cases only method and should be used with caution, as it can create an infinite loop. It's useful for postponing mutations inside a negotiation handler. The returned Result can't be waited on, as prepended mutations don't create a queue tick. Queue returns a copy of the currently active states. (*Machine) QueueLen() uint16 QueueTick is the number of times the queue has processed a mutation. Starts from [1], for easy comparison with [Result]. Remove deactivates a list of states in the machine, returning the result of the transition (Executed, Queued, Canceled). Like every mutation method, it will resolve relations and trigger handlers. Remove1 is [Machine.Remove1] for a single state. Resolver returns the relation resolver, used to produce target states of transitions. Schema returns a copy of machine's schema. SchemaVer return the current version of the schema. SemLogger returns the semantic logger of the machine Set deactivates a list of states in the machine, returning the result of the transition (Executed, Canceled, Queued). Like every mutation method, it will resolve relations and trigger handlers. SetGroups organizes the schema into a tree using schema-v2 structs. SetGroupsString is like SetGroups, but work with the schema-v1 format. SetSchema sets the machine's schema. It will automatically call VerifyStates with the names param and handle EventSchemaChange if successful. The new schema has to be longer than the previous one (no relations-only changes). The length of the schema is also the version of the schema. SetTags updates the machine's tags with the provided slice of strings. StateNames returns a SHARED copy of all the state names. TODO docs StatesVerified returns true if the state names have been ordered using VerifyStates. String returns a one line representation of the currently active states, with their clock values. Inactive states are omitted. Eg: (Foo:1 Bar:3) StringAll returns a one line representation of all the states, with their clock values. Inactive states are in square brackets. (Foo:1 Bar:3) [Baz:2] Switch returns the first state from the passed list that is currently active, making it handy for switch statements. Useful for state groups. switch mach.Switch(ss.GroupPlaying) { case "Playing": case "Paused": case "Stopped": } Tags returns machine's tags, a list of unstructured strings without spaces. Tick return the current tick for a given state. Time returns machine's time, a list of ticks per state. Returned value includes the specified states, or all the states if nil. Toggle deactivates a list of states in case all are active, or activates them otherwise. Returns the result of the transition (Executed, Queued, Canceled). Toggle1 activates or deactivates a single state, depending on its current state. Returns the result of the transition (Executed, Queued, Canceled). Tracers return a copy of currenty attached tracers. Transition returns the current transition, if any. VerifyStates verifies an array of state names and returns an error in case at least one isn't defined. It also retains the order and uses it for StateNames. Verification can be checked via Machine.StatesVerified. WasClock checks if the passed time has happened (or happening right now). Returns false if at least one state is too early. WasTime checks if the passed time has happened (or happening right now). Returns false if at least one state is too early. The states param is optional and can be used to check only a subset of states. When returns a channel that will be closed when all the passed states become active or the machine gets disposed. ctx: optional context that will close the channel early. When1 is an alias to When() for a single state. See When. WhenArgs returns a channel that will be closed when the passed state becomes active with all the passed args. Args are compared using the native '=='. It's meant to be used with async Multi states, to filter out a specific call. ctx: optional context that will close the channel when handler loop ends. WhenDisposed returns a channel that will be closed when the machine is disposed. Requires bound handlers. Use Machine.disposed in case no handlers have been bound. WhenErr returns a channel that will be closed when the machine is in the StateException state. ctx: optional context that will close the channel early. WhenNot returns a channel that will be closed when all the passed states become inactive or the machine gets disposed. ctx: optional context that will close the channel early. WhenNot1 is an alias to WhenNot() for a single state. See WhenNot. WhenQuery returns a channel that will be closed when the passed [clockCheck] function returns true. [clockCheck] should be a pure function and non-blocking.` ctx: optional context that will close the channel early. WhenQueue waits until the passed queueTick gets processed. TODO example WhenQueueEnds closes every time the queue ends, or the optional ctx expires. ctx: optional context that will close the channel early. WhenTicks waits N ticks of a single state (relative to now). Uses WhenTime underneath. ctx: optional context that will close the channel early. WhenTime returns a channel that will be closed when all the passed states have passed the specified time. The time is a logical clock of the state. Machine time can be sourced from [Machine.Time](), or [Machine.Clock](). ctx: optional context that will close the channel early. WhenTime1 waits till ticks for a single state equal the given value (or more). ctx: optional context that will close the channel early. WillBe returns true if the passed states are scheduled to be activated. Does not cover implied states, only called ones. See [Machine.IsQueued] to perform more detailed queries. position: optional position assertion WillBe1 returns true if the passed state is scheduled to be activated. See IsQueued to perform more detailed queries. WillBeRemoved returns true if the passed states are scheduled to be deactivated. Does not cover implied states, only called ones. See [Machine.IsQueued] to perform more detailed queries. position: optional position assertion WillBeRemoved1 returns true if the passed state is scheduled to be deactivated. See IsQueued to perform more detailed queries. *Machine : Api *Machine : expvar.Var *Machine : fmt.Stringer func New(ctx context.Context, schema Schema, opts *Opts) *Machine func NewCommon(ctx context.Context, id string, stateSchema Schema, stateNames S, handlers any, parent Api, opts *Opts) (*Machine, error) func (*Event).Machine() *Machine func github.com/pancsta/asyncmachine-go/pkg/helpers.NewMirror(id string, flat bool, source *Machine, handlers any, states S) (*Machine, error) func github.com/pancsta/asyncmachine-go/examples/mach_template.NewTemplate(ctx context.Context, num int) (*Machine, error) func github.com/pancsta/asyncmachine-go/examples/temporal_fileprocessing.FileProcessingFlow(ctx context.Context, log temporal_fileprocessing.Logger, filename string) (*Machine, error) func github.com/pancsta/asyncmachine-go/examples/tui/states.NewTui(ctx context.Context) *Machine func github.com/pancsta/asyncmachine-go/internal/testing.NewRpcTest(t *testing.T, ctx context.Context, netSrc *Machine, consumer *Machine) (*Machine, *rpc.Server, *rpc.Client) func github.com/pancsta/asyncmachine-go/internal/testing/states.NewRel(ctx context.Context) *Machine func github.com/pancsta/asyncmachine-go/internal/testing/utils.NewCustom(t *testing.T, states Schema) *Machine func github.com/pancsta/asyncmachine-go/internal/testing/utils.NewCustomNetSrc(t *testing.T, states Schema) *Machine func github.com/pancsta/asyncmachine-go/internal/testing/utils.NewNoRels(t *testing.T, initialState S, suffix string) *Machine func github.com/pancsta/asyncmachine-go/internal/testing/utils.NewNoRelsNetSrc(t *testing.T, initialState S) *Machine func github.com/pancsta/asyncmachine-go/internal/testing/utils.NewNoRelsNetSrcSchema(t *testing.T, initialState S, overlay Schema) *Machine func github.com/pancsta/asyncmachine-go/internal/testing/utils.NewRels(t *testing.T, initialState S) *Machine func github.com/pancsta/asyncmachine-go/internal/testing/utils.NewRelsNetSrc(t *testing.T, initialState S) *Machine func github.com/pancsta/asyncmachine-go/internal/testing/utils.NewRelsNodeWorker(t *testing.T, initialState S) *Machine func MockClock(mach *Machine, clock Clock) func NewEvent(mach *Machine, machApi Api) *Event func github.com/pancsta/asyncmachine-go/pkg/graph.New(server *Machine) (*graph.Graph, error) func github.com/pancsta/asyncmachine-go/pkg/helpers.CopySchema(source Schema, target *Machine, states S) error func github.com/pancsta/asyncmachine-go/pkg/helpers.EvalGetter[T](ctx context.Context, source string, maxTries int, mach *Machine, eval func() (T, error)) (T, error) func github.com/pancsta/asyncmachine-go/pkg/helpers.NewMirror(id string, flat bool, source *Machine, handlers any, states S) (*Machine, error) func github.com/pancsta/asyncmachine-go/pkg/helpers.NewStateLoop(mach *Machine, loopState string, optCheck func() bool) *helpers.StateLoop func github.com/pancsta/asyncmachine-go/pkg/helpers.WaitForErrAny(ctx context.Context, timeout time.Duration, mach *Machine, chans ...<-chan struct{}) error func github.com/pancsta/asyncmachine-go/pkg/node.AddErrPool(mach *Machine, err error, args A) error func github.com/pancsta/asyncmachine-go/pkg/node.AddErrPoolStr(mach *Machine, msg string, args A) error func github.com/pancsta/asyncmachine-go/pkg/node.AddErrRpc(mach *Machine, err error, args A) error func github.com/pancsta/asyncmachine-go/pkg/node.AddErrWorker(event *Event, mach *Machine, err error, args A) error func github.com/pancsta/asyncmachine-go/pkg/node.AddErrWorkerStr(mach *Machine, msg string, args A) error func github.com/pancsta/asyncmachine-go/pkg/pubsub.AddErrJoining(event *Event, mach *Machine, err error, args A) error func github.com/pancsta/asyncmachine-go/pkg/pubsub.AddErrListening(event *Event, mach *Machine, err error, args A) error func github.com/pancsta/asyncmachine-go/pkg/pubsub.NewTopic(ctx context.Context, name, suffix string, exposedMachs []*Machine, opts *pubsub.TopicOpts) (*pubsub.Topic, error) func github.com/pancsta/asyncmachine-go/pkg/rpc.AddErr(e *Event, mach *Machine, msg string, err error) func github.com/pancsta/asyncmachine-go/pkg/rpc.AddErrNetwork(e *Event, mach *Machine, err error) func github.com/pancsta/asyncmachine-go/pkg/rpc.AddErrNoConn(e *Event, mach *Machine, err error) func github.com/pancsta/asyncmachine-go/pkg/rpc.AddErrParams(e *Event, mach *Machine, err error) func github.com/pancsta/asyncmachine-go/pkg/rpc.AddErrResp(e *Event, mach *Machine, err error) func github.com/pancsta/asyncmachine-go/pkg/rpc.AddErrRpcStr(e *Event, mach *Machine, msg string) func github.com/pancsta/asyncmachine-go/pkg/rpc.BindServer(source, target *Machine, rpcReady, clientConn string) error func github.com/pancsta/asyncmachine-go/pkg/rpc.BindServerMulti(source, target *Machine, rpcReady, clientConn, clientDisconn string) error func github.com/pancsta/asyncmachine-go/pkg/rpc.BindServerRpcReady(source, target *Machine, rpcReady string) error func github.com/pancsta/asyncmachine-go/pkg/rpc.NewNetworkMachine(ctx context.Context, id string, conn rpc.NetMachConn, schema Schema, stateNames S, parent *Machine, tags []string, filterMutations bool) (*rpc.NetworkMachine, *rpc.NetMachInternal, error) func github.com/pancsta/asyncmachine-go/pkg/states.AddErrConnecting(event *Event, mach *Machine, err error, args A) error func github.com/pancsta/asyncmachine-go/pkg/x/helpers.FanOutIn(mach *Machine, name string, total, concurrency int, fn helpers.FanFn) (any, error) func github.com/pancsta/asyncmachine-go/pkg/x/helpers.RelationsMatrix(mach *Machine) ([][]int, error) func github.com/pancsta/asyncmachine-go/pkg/x/helpers.TimeMatrix(machines []*Machine) ([]Time, error) func github.com/pancsta/asyncmachine-go/pkg/x/history/frostdb.(*Memory).Track(onErr func(err error), mach *Machine, calledAllowlist, changedAllowlist S, maxEntries int) (*frostdb.Tracer, error) func github.com/pancsta/asyncmachine-go/examples/mach_template.AddErrExample(event *Event, mach *Machine, err error, args A) error func github.com/pancsta/asyncmachine-go/internal/testing.NewRpcClient(t *testing.T, ctx context.Context, addr string, netSrcSchema Schema, consumer *Machine) *rpc.Client func github.com/pancsta/asyncmachine-go/internal/testing.NewRpcTest(t *testing.T, ctx context.Context, netSrc *Machine, consumer *Machine) (*Machine, *rpc.Server, *rpc.Client) func github.com/pancsta/asyncmachine-go/internal/testing.NewRpcTest(t *testing.T, ctx context.Context, netSrc *Machine, consumer *Machine) (*Machine, *rpc.Server, *rpc.Client) func github.com/pancsta/asyncmachine-go/tools/debugger/server.StartRpc(mach *Machine, addr string, mux chan<- cmux.CMux, fwdAdds []string, enableHttp bool) func github.com/pancsta/asyncmachine-go/tools/generator.MachDashboardEnv(mach *Machine) error func github.com/pancsta/asyncmachine-go/tools/repl.AddErrSyntax(event *Event, mach *Machine, err error, args A) error
Mutation represents an atomic change (or an attempt) of machine's active states. Mutation causes a Transition. argument map passed to the mutation method (if any). States explicitly passed to the mutation method, as their indexes. Use Transition.CalledStates or IndexToStates to get the actual state names. this mutation has been triggered by an auto state TODO rename to IsAuto IsCheck indicates that this mutation is a check, see [Machine.CanAdd]. QueueLen is the length of the queue at the time when the mutation was queued. QueueTick is the assigned queue tick at the time when the mutation was queued. 0 for prepended mutations. QueueTickNow is the queue tick during which this mutation was scheduled. QueueToken is a unique ID, which is given to prepended mutations. Tokens are assigned in a series but executed in random order. QueueTokensLen is the amount of unexecuted queue tokens (priority queue). TODO impl Source is the source event for this mutation. add, set, remove (*Mutation) CalledIndex(index S) *TimeIndex (*Mutation) IsCalled(idx int) bool LogArgs returns a text snippet with arguments which should be logged for this Mutation. MapArgs returns arguments of this Mutation which match the passed [mapper]. The returned map is never nil. (*Mutation) String() string (*Mutation) StringFromIndex(index S) string *Mutation : expvar.Var *Mutation : fmt.Stringer func (*DefaultRelationsResolver).NewAutoMutation() (*Mutation, S) func (*Event).Mutation() *Mutation func (*Machine).Queue() []*Mutation func RelationsResolver.NewAutoMutation() (*Mutation, S) func (*Machine).PrependMut(mut *Mutation) Result func Tracer.MutationQueued(machine Api, mutation *Mutation) func (*TracerNoOp).MutationQueued(machine Api, mutation *Mutation) func github.com/pancsta/asyncmachine-go/pkg/telemetry.(*DbgTracer).MutationQueued(mach Api, mut *Mutation)
MutationType enum ( MutationType) String() string MutationType : expvar.Var MutationType : fmt.Stringer func (*Transition).Type() MutationType func (*Machine).IsQueued(mutType MutationType, states S, withoutArgsOnly bool, statesStrictEqual bool, minQueueTick uint64, isCheck bool, position Position) (found bool, idx uint16, qTick uint64) func (*Machine).IsQueuedAbove(threshold int, mutType MutationType, states S, withoutArgsOnly bool, statesStrictEqual bool, minQueueTick uint64) bool func github.com/pancsta/asyncmachine-go/pkg/helpers.NewMutRequest(mach Api, mutType MutationType, states S, args A) *helpers.MutRequest func github.com/pancsta/asyncmachine-go/pkg/helpers.(*MutRequest).Clone(mach Api, mutType MutationType, states S, args A) *helpers.MutRequest const MutationAdd const MutationRemove const MutationSet
MachId string Machine time of the source machine BEFORE the event. TxId string
Opts struct is used to configure a new [Machine]. DetectEval will detect Eval calls directly in handlers, which causes a deadlock. It works in similar way as -race flag in Go and can also be triggered by setting either env var: AM_DEBUG=1 or AM_DETECT_EVAL=1. Default: false. If true, the machine will NOT prefix its logs with its ID. If true, the machine will NOT print all exceptions to stdout. If true, the machine will die on panics. HandlerBackoff time.Duration TODO docs Time for a handler to execute. Default: time.Second Unique ID of this machine. Default: random ID. LogArgs matching function for the machine. Default: nil. Log level of the machine. Default: [LogNothing]. Parent machine, used to inherit certain properties, e.g. tracers. Overrides ParentID. Default: nil. ParentID is the ID of the parent machine. Default: "". QueueLimit is the maximum number of mutations that can be queued. Default: 1000. Custom relations resolver. Default: *[DefaultRelationsResolver]. Tags is a list of tags for the machine. Default: nil. Tracer for the machine. Default: nil. func OptsWithDebug(opts *Opts) *Opts func OptsWithTracers(opts *Opts, tracers ...Tracer) *Opts func New(ctx context.Context, schema Schema, opts *Opts) *Machine func NewCommon(ctx context.Context, id string, stateSchema Schema, stateNames S, handlers any, parent Api, opts *Opts) (*Machine, error) func OptsWithDebug(opts *Opts) *Opts func OptsWithTracers(opts *Opts, tracers ...Tracer) *Opts
Position describes the item's position in a list. Used mostly for the queue in [Machine.IsQueued]. func (*Machine).IsQueued(mutType MutationType, states S, withoutArgsOnly bool, statesStrictEqual bool, minQueueTick uint64, isCheck bool, position Position) (found bool, idx uint16, qTick uint64) func (*Machine).WillBe(states S, position ...Position) bool func (*Machine).WillBe1(state string, position ...Position) bool func (*Machine).WillBeRemoved(states S, position ...Position) bool func (*Machine).WillBeRemoved1(state string, position ...Position) bool const PositionAny const PositionFirst const PositionLast
Relation enum ( Relation) String() string Relation : expvar.Var Relation : fmt.Stringer func (*DefaultRelationsResolver).RelationsBetween(fromState, toState string) ([]Relation, error) func (*DefaultRelationsResolver).RelationsOf(fromState string) ([]Relation, error) func RelationsResolver.RelationsBetween(fromState, toState string) ([]Relation, error) func RelationsResolver.RelationsOf(fromState string) ([]Relation, error) const RelationAdd const RelationAfter const RelationRemove const RelationRequire
RelationsResolver is an interface for parsing relations between states. Not thread-safe. TODO support custom relation types and additional state properties. TODO refac Relations ( RelationsResolver) InboundRelationsOf(toState string) (S, error) NewAutoMutation returns an (optional) auto mutation which is appended to the queue after the transition is executed. It also returns the names of the called states. NewSchema runs when Machine receives a new struct. RelationsBetween returns a list of relation types between the given states. RelationsOf returns a list of relation types of the given state. SortStates sorts the states in the order their handlers should be executed. TargetStates returns the target states after parsing the relations. *DefaultRelationsResolver func (*Machine).Resolver() RelationsResolver
Result enum is the result of a state [Transition]. [Queued] is a virtual value and everything >= Queued (2) represents a queue tick on which the mutation will be processed. It's useful for queued negotiations. ( Result) String() string Result : expvar.Var Result : fmt.Stringer func Api.Add(states S, args A) Result func Api.Add1(state string, args A) Result func Api.AddErr(err error, args A) Result func Api.AddErrState(state string, err error, args A) Result func Api.CanAdd(states S, args A) Result func Api.CanAdd1(state string, args A) Result func Api.CanRemove(states S, args A) Result func Api.CanRemove1(state string, args A) Result func Api.EvAdd(event *Event, states S, args A) Result func Api.EvAdd1(event *Event, state string, args A) Result func Api.EvAddErr(event *Event, err error, args A) Result func Api.EvAddErrState(event *Event, state string, err error, args A) Result func Api.EvRemove(event *Event, states S, args A) Result func Api.EvRemove1(event *Event, state string, args A) Result func Api.EvToggle(event *Event, states S, args A) Result func Api.EvToggle1(event *Event, state string, args A) Result func Api.Remove(states S, args A) Result func Api.Remove1(state string, args A) Result func Api.Set(states S, args A) Result func Api.Toggle(states S, args A) Result func Api.Toggle1(state string, args A) Result func (*Machine).Add(states S, args A) Result func (*Machine).Add1(state string, args A) Result func (*Machine).AddErr(err error, args A) Result func (*Machine).AddErrState(state string, err error, args A) Result func (*Machine).CanAdd(states S, args A) Result func (*Machine).CanAdd1(state string, args A) Result func (*Machine).CanRemove(states S, args A) Result func (*Machine).CanRemove1(state string, args A) Result func (*Machine).EvAdd(event *Event, states S, args A) Result func (*Machine).EvAdd1(event *Event, state string, args A) Result func (*Machine).EvAddErr(event *Event, err error, args A) Result func (*Machine).EvAddErrState(event *Event, state string, err error, args A) Result func (*Machine).EvRemove(event *Event, states S, args A) Result func (*Machine).EvRemove1(event *Event, state string, args A) Result func (*Machine).EvToggle(e *Event, states S, args A) Result func (*Machine).EvToggle1(e *Event, state string, args A) Result func (*Machine).PrependMut(mut *Mutation) Result func (*Machine).Remove(states S, args A) Result func (*Machine).Remove1(state string, args A) Result func (*Machine).Set(states S, args A) Result func (*Machine).Toggle(states S, args A) Result func (*Machine).Toggle1(state string, args A) Result func github.com/pancsta/asyncmachine-go/pkg/helpers.Add1Async(ctx context.Context, mach Api, waitState string, addState string, args A) Result func github.com/pancsta/asyncmachine-go/pkg/helpers.Add1Block(ctx context.Context, mach Api, state string, args A) Result func github.com/pancsta/asyncmachine-go/pkg/helpers.Add1Sync(ctx context.Context, mach Api, state string, args A) Result func github.com/pancsta/asyncmachine-go/pkg/helpers.AskAdd(mach Api, states S, args A) Result func github.com/pancsta/asyncmachine-go/pkg/helpers.AskAdd1(mach Api, state string, args A) Result func github.com/pancsta/asyncmachine-go/pkg/helpers.AskEvAdd(e *Event, mach Api, states S, args A) Result func github.com/pancsta/asyncmachine-go/pkg/helpers.AskEvAdd1(e *Event, mach Api, state string, args A) Result func github.com/pancsta/asyncmachine-go/pkg/helpers.AskEvRemove(e *Event, mach Api, states S, args A) Result func github.com/pancsta/asyncmachine-go/pkg/helpers.AskEvRemove1(e *Event, mach Api, state string, args A) Result func github.com/pancsta/asyncmachine-go/pkg/helpers.AskRemove(mach Api, states S, args A) Result func github.com/pancsta/asyncmachine-go/pkg/helpers.AskRemove1(mach Api, state string, args A) Result func github.com/pancsta/asyncmachine-go/pkg/helpers.(*MutRequest).Run(ctx context.Context) (Result, error) func github.com/pancsta/asyncmachine-go/pkg/integrations/nats.Add(ctx context.Context, nc *nats.Conn, topic, machID string, states S, args A) (Result, error) func github.com/pancsta/asyncmachine-go/pkg/integrations/nats.Remove(ctx context.Context, nc *nats.Conn, machID, topic string, states S, args A) (Result, error) func github.com/pancsta/asyncmachine-go/pkg/node.(*Worker).Start(bootAddr string) Result func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Topic).Dispose() Result func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Topic).Join() Result func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Topic).Start() Result func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Topic).StartAndJoin(ctx context.Context) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*Client).Start() Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*Client).Stop(waitTillExit context.Context, dispose bool) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*Mux).Start() Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*Mux).Stop(dispose bool) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).Add(states S, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).Add1(state string, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).Add1NS(state string, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).AddErr(err error, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).AddErrState(state string, err error, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).AddNS(states S, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).CanAdd(states S, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).CanAdd1(state string, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).CanRemove(states S, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).CanRemove1(state string, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).EvAdd(event *Event, states S, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).EvAdd1(event *Event, state string, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).EvAddErr(event *Event, err error, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).EvAddErrState(event *Event, state string, err error, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).EvRemove(event *Event, states S, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).EvRemove1(event *Event, state string, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).EvToggle(e *Event, states S, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).EvToggle1(e *Event, state string, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).Remove(states S, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).Remove1(state string, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).Set(states S, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).Toggle(states S, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).Toggle1(state string, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*Server).Start() Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*Server).Stop(dispose bool) Result func github.com/pancsta/asyncmachine-go/pkg/x/helpers.NestedState(e *Event, strIDField string, machGetter func(id string) *Machine) (Result, <-chan struct{}, error) func IsQueued(result Result) bool func Api.WhenQueue(tick Result) <-chan struct{} func (*Machine).WhenQueue(tick Result) <-chan struct{} func (*Subscriptions).WhenQueue(tick Result) <-chan struct{} func github.com/pancsta/asyncmachine-go/pkg/helpers.ResultToErr(result Result) error func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).WhenQueue(tick Result) <-chan struct{} const Canceled const Executed const Queued
S (state names) is a string list of state names. Filter returns a subset of S from specified indexes. func IndexToStates(index S, states []int) S func SAdd(states ...S) S func SRem(src S, states ...S) S func StatesDiff(states1 S, states2 S) S func StatesShared(states1 S, states2 S) S func Api.ActiveStates(states S) S func Api.ParseStates(states S) S func Api.StateNames() S func Api.StateNamesMatch(re *regexp.Regexp) S func (*DefaultRelationsResolver).InboundRelationsOf(toState string) (S, error) func (*DefaultRelationsResolver).NewAutoMutation() (*Mutation, S) func (*DefaultRelationsResolver).TargetStates(t *Transition, statesToSet, index S) S func (*Machine).ActiveStates(states S) S func (*Machine).ParseStates(states S) S func (*Machine).StateNames() S func (*Machine).StateNamesMatch(re *regexp.Regexp) S func RelationsResolver.InboundRelationsOf(toState string) (S, error) func RelationsResolver.NewAutoMutation() (*Mutation, S) func RelationsResolver.TargetStates(t *Transition, calledStates, index S) S func S.Filter(idxs []int) S func States.Names() S func (*StatesBase).Names() S func TimeIndex.ActiveStates(states S) S func TimeIndex.NonZeroStates() S func (*Transition).CalledStates() S func (*Transition).StatesBefore() S func (*Transition).TargetStates() S func github.com/pancsta/asyncmachine-go/pkg/helpers.GetTransitionStates(tx *Transition, index S) (added S, removed S, touched S) func github.com/pancsta/asyncmachine-go/pkg/helpers.GetTransitionStates(tx *Transition, index S) (added S, removed S, touched S) func github.com/pancsta/asyncmachine-go/pkg/helpers.GetTransitionStates(tx *Transition, index S) (added S, removed S, touched S) func github.com/pancsta/asyncmachine-go/pkg/helpers.IndexesToStates(allStates S, indexes []int) S func github.com/pancsta/asyncmachine-go/pkg/helpers.SchemaStates(schema Schema) S func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).ActiveStates(states S) S func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).MustParseStates(states S) S func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).ParseStates(states S) S func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).StateNames() S func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).StateNamesMatch(re *regexp.Regexp) S func github.com/pancsta/asyncmachine-go/pkg/telemetry.(*DbgMsgTx).ActiveStates(statesIndex S) S func github.com/pancsta/asyncmachine-go/pkg/telemetry.(*DbgMsgTx).CalledStateNames(statesIndex S) S func github.com/pancsta/asyncmachine-go/tools/debugger/server.(*Client).IndexesToStates(indexes []int) S func IndexToStates(index S, states []int) S func IndexToTime(index S, active []int) Time func IsHandler(states S, method string) (string, string) func ListHandlers(handlers any, states S) ([]string, error) func NewCommon(ctx context.Context, id string, stateSchema Schema, stateNames S, handlers any, parent Api, opts *Opts) (*Machine, error) func NewTimeIndex(index S, activeStates []int) *TimeIndex func SAdd(states ...S) S func SRem(src S, states ...S) S func SRem(src S, states ...S) S func StatesDiff(states1 S, states2 S) S func StatesDiff(states1 S, states2 S) S func StatesEqual(states1 S, states2 S) bool func StatesEqual(states1 S, states2 S) bool func StatesShared(states1 S, states2 S) S func StatesShared(states1 S, states2 S) S func StatesToIndex(index S, states S) []int func StatesToIndex(index S, states S) []int func Api.ActiveStates(states S) S func Api.Add(states S, args A) Result func Api.AddBreakpoint(added S, removed S, strict bool) func Api.AddBreakpoint(added S, removed S, strict bool) func Api.Any(states ...S) bool func Api.CanAdd(states S, args A) Result func Api.CanRemove(states S, args A) Result func Api.Clock(states S) Clock func Api.EvAdd(event *Event, states S, args A) Result func Api.EvRemove(event *Event, states S, args A) Result func Api.EvToggle(event *Event, states S, args A) Result func Api.Has(states S) bool func Api.Index(states S) []int func Api.Inspect(states S) string func Api.Is(states S) bool func Api.IsTime(time Time, states S) bool func Api.Not(states S) bool func Api.ParseStates(states S) S func Api.Remove(states S, args A) Result func Api.Set(states S, args A) Result func Api.Switch(groups ...S) string func Api.Time(states S) Time func Api.Toggle(states S, args A) Result func Api.WasTime(time Time, states S) bool func Api.When(states S, ctx context.Context) <-chan struct{} func Api.WhenNot(states S, ctx context.Context) <-chan struct{} func Api.WhenTime(states S, times Time, ctx context.Context) <-chan struct{} func (*DefaultRelationsResolver).NewSchema(schema Schema, states S) func (*DefaultRelationsResolver).SortStates(states S) func (*DefaultRelationsResolver).TargetStates(t *Transition, statesToSet, index S) S func (*Machine).ActiveStates(states S) S func (*Machine).Add(states S, args A) Result func (*Machine).AddBreakpoint(added S, removed S, strict bool) func (*Machine).AddBreakpoint(added S, removed S, strict bool) func (*Machine).Any(states ...S) bool func (*Machine).CanAdd(states S, args A) Result func (*Machine).CanRemove(states S, args A) Result func (*Machine).Clock(states S) Clock func (*Machine).EvAdd(event *Event, states S, args A) Result func (*Machine).EvRemove(event *Event, states S, args A) Result func (*Machine).EvToggle(e *Event, states S, args A) Result func (*Machine).Has(states S) bool func (*Machine).Index(states S) []int func (*Machine).Inspect(states S) string func (*Machine).Is(states S) bool func (*Machine).IsQueued(mutType MutationType, states S, withoutArgsOnly bool, statesStrictEqual bool, minQueueTick uint64, isCheck bool, position Position) (found bool, idx uint16, qTick uint64) func (*Machine).IsQueuedAbove(threshold int, mutType MutationType, states S, withoutArgsOnly bool, statesStrictEqual bool, minQueueTick uint64) bool func (*Machine).IsTime(t Time, states S) bool func (*Machine).Not(states S) bool func (*Machine).ParseStates(states S) S func (*Machine).Remove(states S, args A) Result func (*Machine).Set(states S, args A) Result func (*Machine).SetGroupsString(groups map[string]S, order []string) func (*Machine).SetSchema(newSchema Schema, names S) error func (*Machine).Switch(groups ...S) string func (*Machine).Time(states S) Time func (*Machine).Toggle(states S, args A) Result func (*Machine).VerifyStates(states S) error func (*Machine).WasTime(t Time, states S) bool func (*Machine).When(states S, ctx context.Context) <-chan struct{} func (*Machine).WhenNot(states S, ctx context.Context) <-chan struct{} func (*Machine).WhenTime(states S, times Time, ctx context.Context) <-chan struct{} func (*Machine).WillBe(states S, position ...Position) bool func (*Machine).WillBeRemoved(states S, position ...Position) bool func (*Mutation).CalledIndex(index S) *TimeIndex func (*Mutation).StringFromIndex(index S) string func RelationsResolver.NewSchema(schema Schema, states S) func RelationsResolver.SortStates(states S) func RelationsResolver.TargetStates(t *Transition, calledStates, index S) S func States.SetNames(S) func (*StatesBase).SetNames(names S) func (*Step).GetFromState(index S) string func (*Step).GetToState(index S) string func (*Step).StringFromIndex(idx S) string func (*Subscriptions).ProcessStateCtx(deactivated S) []context.CancelFunc func (*Subscriptions).ProcessWhen(activated, deactivated S) []chan struct{} func (*Subscriptions).When(states S, ctx context.Context) <-chan struct{} func (*Subscriptions).WhenNot(states S, ctx context.Context) <-chan struct{} func (*Subscriptions).WhenTime(states S, times Time, ctx context.Context) <-chan struct{} func Time.ToIndex(index S) *TimeIndex func TimeIndex.ActiveStates(states S) S func TimeIndex.Filter(states S) *TimeIndex func TimeIndex.Is(states S) bool func TimeIndex.Not(states S) bool func TimeIndex.Sum(states S) uint64 func github.com/pancsta/asyncmachine-go/pkg/helpers.AskAdd(mach Api, states S, args A) Result func github.com/pancsta/asyncmachine-go/pkg/helpers.AskEvAdd(e *Event, mach Api, states S, args A) Result func github.com/pancsta/asyncmachine-go/pkg/helpers.AskEvRemove(e *Event, mach Api, states S, args A) Result func github.com/pancsta/asyncmachine-go/pkg/helpers.AskRemove(mach Api, states S, args A) Result func github.com/pancsta/asyncmachine-go/pkg/helpers.CantAdd(mach Api, states S, args A) bool func github.com/pancsta/asyncmachine-go/pkg/helpers.CantRemove(mach Api, states S, args A) bool func github.com/pancsta/asyncmachine-go/pkg/helpers.CopySchema(source Schema, target *Machine, states S) error func github.com/pancsta/asyncmachine-go/pkg/helpers.GetTransitionStates(tx *Transition, index S) (added S, removed S, touched S) func github.com/pancsta/asyncmachine-go/pkg/helpers.Implements(statesChecked, statesNeeded S) error func github.com/pancsta/asyncmachine-go/pkg/helpers.IndexesToStates(allStates S, indexes []int) S func github.com/pancsta/asyncmachine-go/pkg/helpers.NewMirror(id string, flat bool, source *Machine, handlers any, states S) (*Machine, error) func github.com/pancsta/asyncmachine-go/pkg/helpers.NewMutRequest(mach Api, mutType MutationType, states S, args A) *helpers.MutRequest func github.com/pancsta/asyncmachine-go/pkg/helpers.NewReqAdd(mach Api, states S, args A) *helpers.MutRequest func github.com/pancsta/asyncmachine-go/pkg/helpers.NewReqRemove(mach Api, states S, args A) *helpers.MutRequest func github.com/pancsta/asyncmachine-go/pkg/helpers.SchemaImplements(schema Schema, states S) error func github.com/pancsta/asyncmachine-go/pkg/helpers.StatesToIndexes(allStates S, states S) []int func github.com/pancsta/asyncmachine-go/pkg/helpers.StatesToIndexes(allStates S, states S) []int func github.com/pancsta/asyncmachine-go/pkg/helpers.(*MutRequest).Clone(mach Api, mutType MutationType, states S, args A) *helpers.MutRequest func github.com/pancsta/asyncmachine-go/pkg/helpers/testing.AssertIs(t *stdtest.T, mach Api, states S) func github.com/pancsta/asyncmachine-go/pkg/helpers/testing.AssertNot(t *stdtest.T, mach Api, states S) func github.com/pancsta/asyncmachine-go/pkg/history.(*BaseMemory).Index(states S) []int func github.com/pancsta/asyncmachine-go/pkg/history.(*BaseMemory).IsTracked(states S) bool func github.com/pancsta/asyncmachine-go/pkg/history.MemoryApi.Index(states S) []int func github.com/pancsta/asyncmachine-go/pkg/history.MemoryApi.IsTracked(states S) bool func github.com/pancsta/asyncmachine-go/pkg/integrations/nats.Add(ctx context.Context, nc *nats.Conn, topic, machID string, states S, args A) (Result, error) func github.com/pancsta/asyncmachine-go/pkg/integrations/nats.Remove(ctx context.Context, nc *nats.Conn, machID, topic string, states S, args A) (Result, error) func github.com/pancsta/asyncmachine-go/pkg/node.NewWorker(ctx context.Context, kind string, workerStruct Schema, stateNames S, opts *node.WorkerOpts) (*node.Worker, error) func github.com/pancsta/asyncmachine-go/pkg/rpc.NewNetworkMachine(ctx context.Context, id string, conn rpc.NetMachConn, schema Schema, stateNames S, parent *Machine, tags []string, filterMutations bool) (*rpc.NetworkMachine, *rpc.NetMachInternal, error) func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).ActiveStates(states S) S func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).Add(states S, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).AddBreakpoint(added S, removed S, strict bool) func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).AddBreakpoint(added S, removed S, strict bool) func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).AddNS(states S, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).Any(states ...S) bool func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).CanAdd(states S, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).CanRemove(states S, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).Clock(states S) Clock func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).EvAdd(event *Event, states S, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).EvRemove(event *Event, states S, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).EvToggle(e *Event, states S, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).Has(states S) bool func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).Index(states S) []int func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).Inspect(states S) string func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).Is(states S) bool func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).IsTime(t Time, states S) bool func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).MustParseStates(states S) S func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).Not(states S) bool func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).ParseStates(states S) S func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).Remove(states S, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).Set(states S, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).Switch(groups ...S) string func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).Time(states S) Time func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).Toggle(states S, args A) Result func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).WasTime(t Time, states S) bool func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).When(states S, ctx context.Context) <-chan struct{} func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).WhenNot(states S, ctx context.Context) <-chan struct{} func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).WhenTime(states S, times Time, ctx context.Context) <-chan struct{} func github.com/pancsta/asyncmachine-go/pkg/states/pipes.BindMany(source, target Api, states, targetStates S) error func github.com/pancsta/asyncmachine-go/pkg/telemetry.DbgMsg.Clock(statesIndex S, state string) uint64 func github.com/pancsta/asyncmachine-go/pkg/telemetry.DbgMsg.Is(statesIndex S, states S) bool func github.com/pancsta/asyncmachine-go/pkg/telemetry.DbgMsg.Is(statesIndex S, states S) bool func github.com/pancsta/asyncmachine-go/pkg/telemetry.(*DbgMsgStruct).Clock(_ S, _ string) uint64 func github.com/pancsta/asyncmachine-go/pkg/telemetry.(*DbgMsgStruct).Is(_ S, _ S) bool func github.com/pancsta/asyncmachine-go/pkg/telemetry.(*DbgMsgStruct).Is(_ S, _ S) bool func github.com/pancsta/asyncmachine-go/pkg/telemetry.(*DbgMsgTx).ActiveStates(statesIndex S) S func github.com/pancsta/asyncmachine-go/pkg/telemetry.(*DbgMsgTx).CalledStateNames(statesIndex S) S func github.com/pancsta/asyncmachine-go/pkg/telemetry.(*DbgMsgTx).Clock(statesIndex S, state string) uint64 func github.com/pancsta/asyncmachine-go/pkg/telemetry.(*DbgMsgTx).Index(statesIndex S, state string) int func github.com/pancsta/asyncmachine-go/pkg/telemetry.(*DbgMsgTx).Is(statesIndex S, states S) bool func github.com/pancsta/asyncmachine-go/pkg/telemetry.(*DbgMsgTx).Is(statesIndex S, states S) bool func github.com/pancsta/asyncmachine-go/pkg/telemetry.(*DbgMsgTx).Is1(statesIndex S, state string) bool func github.com/pancsta/asyncmachine-go/pkg/telemetry.(*DbgMsgTx).MutString(statesIndex S) string func github.com/pancsta/asyncmachine-go/pkg/telemetry.(*DbgMsgTx).TxString(statesIndex S) string func github.com/pancsta/asyncmachine-go/pkg/x/helpers.TransitionMatrix(tx, prevTx *Transition, index S) ([][]int, error) func github.com/pancsta/asyncmachine-go/pkg/x/history/frostdb.(*Memory).Track(onErr func(err error), mach *Machine, calledAllowlist, changedAllowlist S, maxEntries int) (*frostdb.Tracer, error) func github.com/pancsta/asyncmachine-go/internal/testing/utils.NewNoRels(t *testing.T, initialState S, suffix string) *Machine func github.com/pancsta/asyncmachine-go/internal/testing/utils.NewNoRelsNetSrc(t *testing.T, initialState S) *Machine func github.com/pancsta/asyncmachine-go/internal/testing/utils.NewNoRelsNetSrcSchema(t *testing.T, initialState S, overlay Schema) *Machine func github.com/pancsta/asyncmachine-go/internal/testing/utils.NewRels(t *testing.T, initialState S) *Machine func github.com/pancsta/asyncmachine-go/internal/testing/utils.NewRelsNetSrc(t *testing.T, initialState S) *Machine func github.com/pancsta/asyncmachine-go/internal/testing/utils.NewRelsNodeWorker(t *testing.T, initialState S) *Machine func github.com/pancsta/asyncmachine-go/tools/debugger/server.(*Client).StatesToIndexes(states S) []int var github.com/pancsta/asyncmachine-go/examples/benchmark_grpc/worker_states.GroupValues var github.com/pancsta/asyncmachine-go/examples/benchmark_grpc/worker_states.Names var github.com/pancsta/asyncmachine-go/examples/path_watcher/states.Names var github.com/pancsta/asyncmachine-go/examples/path_watcher/states.NamesDir var github.com/pancsta/asyncmachine-go/examples/temporal_expense/states.GroupApproval var github.com/pancsta/asyncmachine-go/examples/temporal_expense/states.GroupExpense var github.com/pancsta/asyncmachine-go/examples/temporal_expense/states.GroupPayment var github.com/pancsta/asyncmachine-go/examples/temporal_expense/states.Names var github.com/pancsta/asyncmachine-go/examples/temporal_fileprocessing/states.GroupFileDownloaded var github.com/pancsta/asyncmachine-go/examples/temporal_fileprocessing/states.GroupFileProcessed var github.com/pancsta/asyncmachine-go/examples/temporal_fileprocessing/states.GroupFileUploaded var github.com/pancsta/asyncmachine-go/examples/temporal_fileprocessing/states.Names var github.com/pancsta/asyncmachine-go/internal/testing/states.Names var github.com/pancsta/asyncmachine-go/internal/testing/utils.RelsNodeWorkerStates var github.com/pancsta/asyncmachine-go/tools/debugger/states.GroupDebug var github.com/pancsta/asyncmachine-go/tools/debugger/states.GroupDialog var github.com/pancsta/asyncmachine-go/tools/debugger/states.GroupFilters var github.com/pancsta/asyncmachine-go/tools/debugger/states.GroupFocused var github.com/pancsta/asyncmachine-go/tools/debugger/states.GroupPlaying var github.com/pancsta/asyncmachine-go/tools/debugger/states.GroupSwitchedClientTx var github.com/pancsta/asyncmachine-go/tools/debugger/states.GroupViews var github.com/pancsta/asyncmachine-go/tools/debugger/states.Names
Schema is a map of state names to state definitions.
SemConfig defines a config for SemLogger. Args bool Can bool TODO Graph bool Queued bool StateCtx bool Steps bool When bool func github.com/pancsta/asyncmachine-go/pkg/helpers.SemConfigEnv(forceFull bool) *SemConfig func github.com/pancsta/asyncmachine-go/pkg/helpers.MachDebug(mach Api, amDbgAddr string, logLvl LogLevel, stdout bool, semConfig *SemConfig) error
SemLogger is a semantic logger for structured events. It's consist of: - enable / enabled methods - text logger utils - setters for external semantics (eg pipes) It's WIP, and eventually it will replace (but not remove) the text logger. AddPipeIn informs that [targetState] has been piped into this machine from [sourceMach]. The name of the source state is unknown. AddPipeOut informs that [sourceState] has been piped out into [targetMach]. The name of the target state is unknown. ArgsMapper returns the current log args mapper function. EnableArgs enables or disables the logging known args. EnableCan enables / disables logging of Can* methods. EnableGraph enables / disables logging of graph structures. EnableId enables or disables the logging of the machine's ID in log messages. EnableQueued enables or disables the logging of queued mutations. EnableStateCtx enables or disables the logging of active state contexts. EnableSteps enables / disables logging of transition steps. EnableWhen enables or disables the logging of "when" methods. IsArgs returns true when the machine is logging known args. IsCan return true when the machine is logging Can* methods. IsGraph returns true when the machine is logging graph structures. IsId returns true when the machine is logging the machine's ID in log messages. IsQueued returns true when the machine is logging queued mutations. IsStateCtx returns true when the machine is logging active state contexts. IsSteps return true when the machine is logging transition steps. IsWhen returns true when the machine is logging "when" methods. Level returns the log level of the machine. Logger returns the current custom logger function or nil. RemovePipes removes all pipes for the passed machine ID. SetArgsMapper accepts a function which decides which mutation arguments to log. See NewArgsMapper or create your own manually. SetEmpty creates an empty logger that does nothing and sets the log level in one call. Useful when combined with am-dbg. Requires LogChanges log level to produce any output. SetLevel sets the log level of the machine. SetLogger sets a custom logger function. SetSimple takes log.Printf and sets the log level in one call. Useful for testing. Requires LogChanges log level to produce any output. func Api.SemLogger() SemLogger func (*Machine).SemLogger() SemLogger func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).SemLogger() SemLogger
Serialized is a machine state serialized to a JSON/YAML/TOML compatible struct. One also needs the state Struct to re-create a state machine. ID is the ID of a state machine. TODO refac to Id with the new dbg telemetry protocol MachineTick is a value of [Machine.MachineTick]. nolint:lll QueueTick is a value of [Machine.QueueTick]. StateNames is an ordered list of state names. Time is the [Machine.Time] value. func Api.Export() (*Serialized, Schema, error) func (*Machine).Export() (*Serialized, Schema, error) func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).Export() (*Serialized, Schema, error) func (*Machine).Import(data *Serialized) error
State defines a single state of a machine, its properties and relations. Add S After S Auto bool Multi bool Remove S Require S Tags []string func StateAdd(source State, overlay State) State func StateSet(source State, auto, multi bool, overlay State) State func StateAdd(source State, overlay State) State func StateAdd(source State, overlay State) State func StateSet(source State, auto, multi bool, overlay State) State func StateSet(source State, auto, multi bool, overlay State) State func github.com/pancsta/asyncmachine-go/pkg/helpers.CountRelations(state *State) int
TODO optimize with indexes
Names returns the state names of the state machine. ( States) SetNames(S) ( States) SetStateGroups(map[string][]int, []string) TODO *StatesBase github.com/pancsta/asyncmachine-go/pkg/node/states.BootstrapStatesDef github.com/pancsta/asyncmachine-go/pkg/node/states.ClientStatesDef github.com/pancsta/asyncmachine-go/pkg/node/states.SupervisorStatesDef github.com/pancsta/asyncmachine-go/pkg/node/states.WorkerStatesDef github.com/pancsta/asyncmachine-go/pkg/pubsub/states.TopicStatesDef github.com/pancsta/asyncmachine-go/pkg/rpc/states.ClientStatesDef github.com/pancsta/asyncmachine-go/pkg/rpc/states.ConsumerStatesDef github.com/pancsta/asyncmachine-go/pkg/rpc/states.MuxStatesDef github.com/pancsta/asyncmachine-go/pkg/rpc/states.NetSourceStatesDef github.com/pancsta/asyncmachine-go/pkg/rpc/states.ServerStatesDef github.com/pancsta/asyncmachine-go/pkg/rpc/states.SharedStatesDef github.com/pancsta/asyncmachine-go/pkg/states.BasicStatesDef github.com/pancsta/asyncmachine-go/pkg/states.ConnectedStatesDef github.com/pancsta/asyncmachine-go/pkg/states.ConnPoolStatesDef github.com/pancsta/asyncmachine-go/pkg/states.DisposedStatesDef github.com/pancsta/asyncmachine-go/pkg/x/history/frostdb.BasicStatesDef github.com/pancsta/asyncmachine-go/examples/arpc/states.ExampleStatesDef github.com/pancsta/asyncmachine-go/examples/benchmark_grpc/states.WorkerStatesDef github.com/pancsta/asyncmachine-go/examples/cli/states.CliStatesDef github.com/pancsta/asyncmachine-go/examples/cli_daemon/states.DaemonStatesDef github.com/pancsta/asyncmachine-go/examples/mach_template/states.MachTemplateStatesDef github.com/pancsta/asyncmachine-go/examples/nfa/states.NfaStatesDef github.com/pancsta/asyncmachine-go/examples/repl/states.ExampleStatesDef github.com/pancsta/asyncmachine-go/examples/tree_state_source/states.FlightsStatesDef github.com/pancsta/asyncmachine-go/examples/tui/states.TuiStatesDef github.com/pancsta/asyncmachine-go/tools/debugger/states.ServerStatesDef github.com/pancsta/asyncmachine-go/tools/generator/states.GeneratorStatesDef github.com/pancsta/asyncmachine-go/tools/relay/states.RelayStatesDef github.com/pancsta/asyncmachine-go/tools/repl/states.ReplStatesDef github.com/pancsta/asyncmachine-go/tools/visualizer/states.VisualizerStatesDef func (*Machine).SetGroups(groups any, optStates States)
Exception is the only built-in state and mean a global error. All errors have to [State.Require] the Exception state. If [Machine.PanicToErr] is true, Exception will receive it. (*StatesBase) Names() S (*StatesBase) SetNames(names S) (*StatesBase) SetStateGroups(groups map[string][]int, order []string) (*StatesBase) StateGroups() (map[string][]int, []string) *StatesBase : States
Step struct represents a single step within a Transition, either a relation resolving step or a handler call. Deprecated, use RelType. TODO remove Deprecated, use GetFromState(). TODO remove TODO implement marks an enter handler (FooState, but not FooEnd). Requires IsFinal. marks a final handler (FooState, FooEnd) marks a self handler (FooFoo) Only for Type == StepRelation. Deprecated, use GetToState(). TODO remove TODO implement Type StepType GetFromState returns the source state of a step. Optional, unless no GetToState(). GetToState returns the target state of a step. Optional, unless no GetFromState(). (*Step) StringFromIndex(idx S) string
StepType enum ( StepType) String() string StepType : expvar.Var StepType : fmt.Stringer const StepCancel const StepHandler const StepRelation const StepRemove const StepRemoveNotActive const StepRequested const StepSet
Subscriptions is an embed responsible for binding subscriptions, managing their indexes, processing triggers, and garbage collection. Mx locks the subscription manager. TODO optimize? (*Subscriptions) HasWhenArgs() bool NewStateCtx returns a new sub-context, bound to the current clock's tick of the passed state. Context cancels when the state has been deactivated, or right away, if it isn't currently active. State contexts are used to check state expirations and should be checked often inside goroutines. ProcessStateCtx collects all deactivated state contexts, and returns theirs cancel funcs. Uses transition caches. ProcessWhen collects all the matched active state subscriptions, and returns theirs channels. ProcessWhenArgs collects all the args-matching subscriptions, and returns theirs channels. (*Subscriptions) ProcessWhenQuery() []chan struct{} (*Subscriptions) ProcessWhenQueue(queueTick uint64) []chan struct{} ProcessWhenQueueEnds collects all queue-end subscriptions, and returns theirs channels. ProcessWhenTime collects all the time-based subscriptions, and returns theirs channels. QueueFlush means a new queue, and all the queue-related subs are expired and have to be closed. SetClock sets a longer clock from an expanded schema. (*Subscriptions) When(states S, ctx context.Context) <-chan struct{} WhenArgs returns a channel that will be closed when the passed state becomes active with all the passed args. Args are compared using the native '=='. It's meant to be used with async Multi states, to filter out a specific call. ctx: optional context that will close the channel when handler loop ends. WhenNot returns a channel that will be closed when all the passed states become inactive or the machine gets disposed. ctx: optional context that will close the channel early. (*Subscriptions) WhenQuery(fn func(clock Clock) bool, ctx context.Context) <-chan struct{} WhenQueue waits until the passed queueTick gets processed. WhenQueueEnds closes every time the queue ends, or the optional ctx expires. This function assumes the queue is running, and wont close early. ctx: optional context that will close the channel early. WhenTime returns a channel that will be closed when all the passed states have passed the specified time. The time is a logical clock of the state. Machine time can be sourced from [Machine.Time](), or [Machine.Clock](). ctx: optional context that will close the channel early. func NewSubscriptionManager(mach Api, clock Clock, is, not InternalCheckFunc, log InternalLogFunc) *Subscriptions
Time is machine time, an ordered list of state ticks. It's like Clock, but indexed by int, instead of string. TODO use math/big? ActiveStates returns a list of active state indexes in this machine time slice. When idxs isn't nil, only the passed indexes are considered. Add sums 2 instances of Time and returns a new one. After returns true if at least 1 tick in time1 is after time2, optionally accepting equal values for true. Requires a deterministic states order, eg by using [Machine.VerifyStates]. Any is [Machine.Any] but for an int-based time slice. Any1 is [Machine.Any1] but for an int-based time slice. Before returns true if at least 1 tick in time1 is before time2, optionally accepting equal values for true. Requires a deterministic states order, eg by using [Machine.VerifyStates]. DiffSince returns the number of ticks for each state in Time since the passed machine time. Equal checks if time1 is equal to time2. Requires a deterministic states order, eg by using [Machine.VerifyStates]. Filter returns a subset of the Time slice for the given state indexes. It's not advised to slice an already sliced time slice. Increment adds 1 to a state's tick value Is is [Machine.Is] but for an int-based time slice. Is1 is [Machine.Is1] but for an int-based time slice. NonZeroStates returns a list of state indexes with non-zero ticks in this machine time slice. Not is [Machine.Not] but for an int-based time slice. Not1 is [Machine.Not1] but for an int-based time slice. String returns an integer representation of the time slice. Sum returns a sum of ticks for each state in Time, or narrowed down to [idxs]. Tick is [Machine.Tick] but for an int-based time slice. ToIndex returns a string-indexed version of Time. Time : expvar.Var Time : fmt.Stringer func IndexToTime(index S, active []int) Time func NewTime(index Time, activeStates []int) Time func Api.Time(states S) Time func (*Machine).Time(states S) Time func Time.Add(t2 Time) Time func Time.DiffSince(before Time) Time func Time.Filter(idxs []int) Time func Time.Increment(idx int) Time func github.com/pancsta/asyncmachine-go/pkg/rpc.(*Client).Sync() Time func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).Time(states S) Time func github.com/pancsta/asyncmachine-go/pkg/x/helpers.TimeMatrix(machines []*Machine) ([]Time, error) func NewTime(index Time, activeStates []int) Time func Api.IsTime(time Time, states S) bool func Api.WasTime(time Time, states S) bool func Api.WhenTime(states S, times Time, ctx context.Context) <-chan struct{} func (*Machine).IsTime(t Time, states S) bool func (*Machine).WasTime(t Time, states S) bool func (*Machine).WhenTime(states S, times Time, ctx context.Context) <-chan struct{} func (*Subscriptions).WhenTime(states S, times Time, ctx context.Context) <-chan struct{} func Time.Add(t2 Time) Time func Time.After(orEqual bool, time2 Time) bool func Time.Before(orEqual bool, time2 Time) bool func Time.DiffSince(before Time) Time func Time.Equal(strict bool, time2 Time) bool func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetMachInternal).UpdateClock(now Time, qTick uint64, machTick uint32) func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).IsTime(t Time, states S) bool func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).WasTime(t Time, states S) bool func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).WhenTime(states S, times Time, ctx context.Context) <-chan struct{}
TimeIndex is [Time] with a bound state index (list of state names). It's not suitable for storage, use [Time] instead. See [Clock] for a simpler type with ticks indexes by state names. Index S Time Time ActiveStates is [Machine.ActiveStates] but for a string-based time slice. Add sums 2 instances of Time and returns a new one. After returns true if at least 1 tick in time1 is after time2, optionally accepting equal values for true. Requires a deterministic states order, eg by using [Machine.VerifyStates]. Any is [Machine.Any] but for a string-based time slice. Any1 is [Machine.Any1] but for a string-based time slice. Before returns true if at least 1 tick in time1 is before time2, optionally accepting equal values for true. Requires a deterministic states order, eg by using [Machine.VerifyStates]. DiffSince returns the number of ticks for each state in Time since the passed machine time. Equal checks if time1 is equal to time2. Requires a deterministic states order, eg by using [Machine.VerifyStates]. Filter is [Time.Filter] but for a string-based time slice. Increment adds 1 to a state's tick value Is is [Machine.Is] but for a string-based time slice. Is1 is [Machine.Is1] but for a string-based time slice. NonZeroStates is [Time.NonZeroStates] but for a string-based time slice. Not is [Machine.Not] but for a string-based time slice. Not1 is [Machine.Not1] but for a string-based time slice. StateName returns the name of the state at the given index. String returns a string representation of the time slice. Sum is [Time.Sum] but for a string-based time slice. Tick is [Machine.Tick] but for an int-based time slice. ToIndex returns a string-indexed version of Time. TimeIndex : expvar.Var TimeIndex : fmt.Stringer func NewTimeIndex(index S, activeStates []int) *TimeIndex func (*Mutation).CalledIndex(index S) *TimeIndex func Time.ToIndex(index S) *TimeIndex func TimeIndex.Filter(states S) *TimeIndex func (*Transition).TimeIndexAfter() TimeIndex
Tracer is an interface for logging machine transitions and events, used by Opts.Tracers and Machine.BindTracer. ( Tracer) HandlerEnd(transition *Transition, emitter string, handler string) ( Tracer) HandlerStart(transition *Transition, emitter string, handler string) ( Tracer) Inheritable() bool ( Tracer) MachineDispose(machID string) MachineInit is called only for machines with tracers added via Opts.Tracers. ( Tracer) MutationQueued(machine Api, mutation *Mutation) ( Tracer) NewSubmachine(parent, machine Api) ( Tracer) QueueEnd(machine Api) ( Tracer) SchemaChange(machine Api, old Schema) ( Tracer) TransitionEnd(transition *Transition) ( Tracer) TransitionInit(transition *Transition) ( Tracer) TransitionStart(transition *Transition) ( Tracer) VerifyStates(machine Api) *LastTxTracer *TracerNoOp *github.com/pancsta/asyncmachine-go/pkg/pubsub.Tracer *github.com/pancsta/asyncmachine-go/pkg/telemetry.DbgTracer *github.com/pancsta/asyncmachine-go/pkg/telemetry.OtelMachTracer github.com/pancsta/asyncmachine-go/pkg/telemetry/prometheus.PromInheritTracer *github.com/pancsta/asyncmachine-go/pkg/telemetry/prometheus.PromTracer *github.com/pancsta/asyncmachine-go/pkg/x/history/frostdb.Tracer *github.com/pancsta/asyncmachine-go/examples/mach_template.Tracer *github.com/pancsta/asyncmachine-go/examples/relations_playground.Tracer *github.com/pancsta/asyncmachine-go/tools/generator.SyncTracer func Api.Tracers() []Tracer func (*Machine).Tracers() []Tracer func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).Tracers() []Tracer func OptsWithTracers(opts *Opts, tracers ...Tracer) *Opts func Api.BindTracer(tracer Tracer) error func Api.DetachTracer(tracer Tracer) error func (*Machine).BindTracer(tracer Tracer) error func (*Machine).DetachTracer(tracer Tracer) error func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).BindTracer(tracer Tracer) error func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).DetachTracer(tracer Tracer) error
TracerNoOp is a no-op implementation of Tracer, used for embedding. (*TracerNoOp) HandlerEnd(transition *Transition, emitter string, handler string) (*TracerNoOp) HandlerStart(transition *Transition, emitter string, handler string) (*TracerNoOp) Inheritable() bool (*TracerNoOp) MachineDispose(machID string) (*TracerNoOp) MachineInit(machine Api) context.Context (*TracerNoOp) MutationQueued(machine Api, mutation *Mutation) (*TracerNoOp) NewSubmachine(parent, machine Api) (*TracerNoOp) QueueEnd(machine Api) (*TracerNoOp) SchemaChange(machine Api, old Schema) (*TracerNoOp) TransitionEnd(transition *Transition) (*TracerNoOp) TransitionInit(transition *Transition) (*TracerNoOp) TransitionStart(transition *Transition) (*TracerNoOp) VerifyStates(machine Api) *TracerNoOp : Tracer
Transition represents processing of a single mutation within a machine. Enters is a list of states activated in this transition. Enters is a list of states deactivated in this transition. Id is a unique identifier of the transition. InternalLogEntriesLock is used to lock the logs to be collected by Tracers. TODO getter? IsAccepted returns true if the transition has been accepted, which can change during the transition's negotiation phase and while resolving relations. TODO true for panic and timeouts IsCompleted returns true when the execution of the transition has been fully completed. TODO confirms relations resolved and negotiation ended LogEntries are log msgs produced during the transition. MachApi is a subset of Machine. TODO call when applicable instead of calling Machine TODO rename to MachApi Machine is the parent machine of this transition. Mutation call which caused this transition PreLogEntries are log msgs produced before during the transition. QueueLen is the length of the queue after the transition. Steps is a list of steps taken by this transition (so far). TargetIndexes is a list of indexes of the target states. TimeAfter is the machine time from after the transition. If the transition has been canceled, this will be the same as TimeBefore. This field is the same as TimeBefore, until the negotiation phase finishes. HasStateChanged is true if the transition has changed the state of the machine. TODO useful? HasStateChanged bool TimeBefore is the machine time from before the transition. Args returns the argument map passed to the mutation method (or an empty one). CalledStates return explicitly called / requested states of the transition. (*Transition) CleanCache() ClockAfter return the Clock from before the transition. ClockBefore return the Clock from before the transition. IsAuto returns true if the transition was triggered by an auto state. Thus, it cant trigger any other auto state mutations. IsHealth returns true if the transition was health-related (StateHealthcheck, StateHeartbeat). StatesBefore is a list of states before the transition. String representation of the transition and the steps taken so far. TargetStates is a list of states after parsing the relations. TimeIndexAfter return TimeAfter bound to an index, for easy quering. Type returns the type of the mutation (add, remove, set). *Transition : expvar.Var *Transition : fmt.Stringer func Api.Transition() *Transition func (*Event).Transition() *Transition func (*LastTxTracer).Load() *Transition func (*Machine).Transition() *Transition func github.com/pancsta/asyncmachine-go/pkg/rpc.(*NetworkMachine).Transition() *Transition func (*DefaultRelationsResolver).TargetStates(t *Transition, statesToSet, index S) S func (*LastTxTracer).TransitionEnd(transition *Transition) func RelationsResolver.TargetStates(t *Transition, calledStates, index S) S func Tracer.HandlerEnd(transition *Transition, emitter string, handler string) func Tracer.HandlerStart(transition *Transition, emitter string, handler string) func Tracer.TransitionEnd(transition *Transition) func Tracer.TransitionInit(transition *Transition) func Tracer.TransitionStart(transition *Transition) func (*TracerNoOp).HandlerEnd(transition *Transition, emitter string, handler string) func (*TracerNoOp).HandlerStart(transition *Transition, emitter string, handler string) func (*TracerNoOp).TransitionEnd(transition *Transition) func (*TracerNoOp).TransitionInit(transition *Transition) func (*TracerNoOp).TransitionStart(transition *Transition) func github.com/pancsta/asyncmachine-go/pkg/helpers.GetTransitionStates(tx *Transition, index S) (added S, removed S, touched S) func github.com/pancsta/asyncmachine-go/pkg/pubsub.(*Tracer).TransitionEnd(transition *Transition) func github.com/pancsta/asyncmachine-go/pkg/telemetry.(*DbgTracer).TransitionEnd(tx *Transition) func github.com/pancsta/asyncmachine-go/pkg/telemetry.(*OtelMachTracer).HandlerEnd(tx *Transition, emitter string, handler string) func github.com/pancsta/asyncmachine-go/pkg/telemetry.(*OtelMachTracer).TransitionEnd(tx *Transition) func github.com/pancsta/asyncmachine-go/pkg/telemetry.(*OtelMachTracer).TransitionInit(tx *Transition) func github.com/pancsta/asyncmachine-go/pkg/telemetry/prometheus.(*PromTracer).TransitionEnd(tx *Transition) func github.com/pancsta/asyncmachine-go/pkg/telemetry/prometheus.(*PromTracer).TransitionInit(tx *Transition) func github.com/pancsta/asyncmachine-go/pkg/x/helpers.TransitionMatrix(tx, prevTx *Transition, index S) ([][]int, error) func github.com/pancsta/asyncmachine-go/pkg/x/history/frostdb.(*Tracer).TransitionEnd(tx *Transition) func github.com/pancsta/asyncmachine-go/examples/mach_template.(*Tracer).TransitionEnd(transition *Transition) func github.com/pancsta/asyncmachine-go/examples/relations_playground.(*Tracer).TransitionEnd(tx *Transition)
type WhenArgsBinding (struct)
Ch chan struct{} Ctx context.Context Matched int means states are required to NOT be active States StateIsActive Total int
Ch chan struct{} Completed StateIsActive Ctx context.Context map of matched to their index positions TODO optimize indexes number of matches so far TODO len(Index) ? optional Time to match for completed from Index number of total matches needed // TODO len(Times) ?
Package-Level Functions (total 36)
Type Parameters: K: comparable V: any AMerge merges 2 or more maps into 1. Useful for passing args from many packages.
CloneSchema deep clones the states struct and returns a copy.
EnvLogLevel returns a log level from an environment variable, AM_LOG by default.
IndexToStates decodes state indexes based on the provided index.
IndexToTime returns "virtual time" with selected states active. It's useful to use time methods on a list of states, eg the called ones.
IsActiveTick returns true if the tick represents an active state (odd number).
IsHandler checks if a method name is a handler method, by returning a state name.
IsQueued returns true if the mutation has been queued, and the result represents the queue time it will be processed.
ListHandlers returns a list of handler method names from a handler struct, limited to [states].
MockClock mocks the internal clock of the machine. Only for testing.
New creates a new Machine instance, bound to context and modified with optional Opts.
NewArgsMapper returns a matcher function for [Opts.LogArgs]. Useful for debugging untyped argument maps. Usually [names] extend defaults from [LogArgs]. maxLen: maximum length of the arg's string representation). Defaults to LogArgsMaxLen,
NewCommon creates a new Machine instance with all the common options set.
NewEvent creates a new Event struct with private fields initialized.
NewLastTxTracer returns a Tracer that logs the last transition.
Type Parameters: G: any
Type Parameters: G: States
NewTime returns a Time of the same len as [index] with active states marked by indexes in [activeStates].
NewTimeIndex returns a TimeIndex of the same len as [index] with active states marked by indexes in [activeStates].
OptsWithDebug returns Opts with debug settings (DontPanicToException, long HandlerTimeout).
OptsWithTracers returns Opts with the given tracers. Tracers are inherited by submachines (via Opts.Parent) when env.AM_DEBUG is set.
ParseArgs extracts AT from A.
func ParseSchema(schema Schema) (Schema, error)
Pass prepares A from AT, to pass to further mutations.
PassMerge prepares A from AT and existing A, to pass to further mutations.
SAdd concatenates multiple state lists into one, removing duplicates. Useful for merging lists of states, eg a state group with other states involved in a relation.
SchemaMerge merges multiple state structs into one, overriding the previous state definitions. No relation-level merging takes place.
SRem removes groups > 1 from nr 1.
StateAdd adds new states to relations of the source state, without removing existing ones. Useful for adjusting shared stated to a specific machine. Only "true" values for Auto and Multi are applied from [overlay].
StatesDiff returns the states that are in states1 but not in states2.
StatesEqual returns true if states1 and states2 are equal, regardless of order.
StateSet replaces passed relations and properties of the source state. Only relations in the overlay state are replaced, the rest is preserved. If [overlay] has all fields `nil`, then only [auto] and [multi] get applied.
StatesShared return states present in both states1 and states2.
StatesToIndex returns a subset of [index] that matches [states]. Unknown states are represented by -1.
Package-Level Variables (total 16)
ErrCanceled indicates that a transition was canceled.
ErrDisposed indicates that the machine has been disposed.
ErrEvalTimeout indicates that an eval func timed out.
ErrHandlerTimeout indicates that a mutation timed out.
ErrInternal happens for internal errors in the machine. These should be reported as bugs.
ErrInvalidArgs indicates that arguments are invalid.
ErrQueued indicates that a mutation was queued. Queuing is a feature, not an error, but it may be considered as such in certain cases.
ErrRelation indicates that a relation definition is invalid.
ErrSchema indicates an issue with the machine schema.
ErrStateInactive indicates that a necessary state isn't active.
ErrStateMissing indicates that states are missing.
ErrStateUnknown indicates that the state is unknown.
ErrTimeout indicates that a generic timeout occurred.
LogArgs is a list of common argument names to be logged. Useful for debugging.
LogArgsMaxLen is the default maximum length of the arg's string representation.
Package-Level Constants (total 45)
Canceled means that the transition was canceled, by either relations or a negotiation handler.
EnvAmDebug enables a simple debugging mode (eg long timeouts). "2" logs to stdout (where applicable) "1" | "2" | "" (default)
EnvAmDetectEval detects evals directly in handlers (use in tests).
EnvAmLog sets the log level. "1" | "2" | "3" | "4" | "5" | "" (default)
EnvAmTestDbgAddr enables test loop integration (no parallel and dbg relay)
EnvAmTestDebug activates debugging in tests.
EnvAmTestRunner indicates a CI test runner.
EnvAmTraceFilter will remove its contents from stack traces, shortening them .
Executed means that the transition was executed immediately and not canceled.
LogChanges means logging state changes and external msgs.
LogDecisions means LogOps + logging all the decisions behind them.
LogEverything means LogDecisions + all event and handler names, and more.
LogExternal will show ony external user msgs.
LogNothing means no logging, including external msgs.
LogOps means LogChanges + logging all the operations.
const PrefixErr = "Err"
Queued means that the transition was queued for later execution. Everything above 2 also means Queued. The following methods can be used to wait for the results: - Machine.When - Machine.WhenNot - Machine.WhenArgs - Machine.WhenTime - Machine.WhenTime1 - Machine.WhenTicks - Machine.WhenQueue - Machine.WhenQueueEnds See [Machine.QueueTick].
TODO refac, 0 should be RelationNone, start from 1, udpate with dbg proto
StateAny is a name of a meta-state used in catch-all handlers.
StateException is the name of the predefined Exception state.
StateHealthcheck is the name of the predefined Healthcheck state.
StateHeartbeat is the name of the predefined Heartbeat state.
StateMachineRestored is the name of the predefined MachineRestored state.
StateReady is the name of the predefined Ready state.
StateStart is the name of the predefined Start state.
const StepCancel StepType = 64
StepRemove indicates a step where a state goes active->inactive TODO rename to StepDeactivate
StepRemoveNotActive indicates a step where a state goes inactive->inactive TODO rename to StepDeactivatePassive
TODO rename to StepActivate
const SuffixEnd = "End"
const SuffixEnter = "Enter"
const SuffixExit = "Exit"
const SuffixState = "State"