Source File
ss_example.go
Belonging Package
github.com/pancsta/asyncmachine-go/examples/repl/states
package statesimport (amssrpc)// ExampleStatesDef contains all the states of the Example state machine.type ExampleStatesDef struct {*am.StatesBaseFoo stringBar stringBaz string// inherit from rpc/WorkerStatesDef*ssrpc.WorkerStatesDef}// ExampleGroupsDef contains all the state groups Example state machine.type ExampleGroupsDef struct {Mutex S}// ExampleSchema represents all relations and properties of ExampleStates.var ExampleSchema = SchemaMerge(// inherit from rpc/WorkerSchemassrpc.WorkerSchema,am.Schema{ssE.Foo: {Remove: sgE.Mutex},ssE.Bar: {Remove: sgE.Mutex},ssE.Baz: {Remove: sgE.Mutex},})// EXPORTS AND GROUPSvar (ssE = am.NewStates(ExampleStatesDef{})sgE = am.NewStateGroups(ExampleGroupsDef{Mutex: S{ssE.Foo, ssE.Bar, ssE.Baz},})// ExampleStates contains all the states for the Example machine.ExampleStates = ssE// ExampleGroups contains all the state groups for the Example machine.ExampleGroups = sgE)
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |