package states
import (
am "github.com/pancsta/asyncmachine-go/pkg/machine"
ssrpc "github.com/pancsta/asyncmachine-go/pkg/rpc/states"
ssam "github.com/pancsta/asyncmachine-go/pkg/states"
. "github.com/pancsta/asyncmachine-go/pkg/states/global"
)
type WorkerStatesDef struct {
*am .StatesBase
ErrWork string
ErrWorkTimeout string
ErrClient string
ErrSupervisor string
Ready string
LocalRpcReady string
PublicRpcReady string
RpcReady string
SuperConnected string
ServeClient string
ClientConnected string
ClientSendPayload string
SuperSendPayload string
Idle string
WorkRequested string
Working string
WorkReady string
*ssam .BasicStatesDef
*ssrpc .WorkerStatesDef
}
type WorkerGroupsDef struct {
WorkStatus S
}
var WorkerSchema = SchemaMerge (
ssam .BasicSchema ,
ssrpc .WorkerSchema ,
am .Schema {
ssW .ErrWork : {Require : S {Exception }},
ssW .ErrWorkTimeout : {Require : S {Exception }},
ssW .ErrClient : {Require : S {Exception }},
ssW .ErrSupervisor : {Require : S {Exception }},
ssW .LocalRpcReady : {Require : S {ssW .Start }},
ssW .PublicRpcReady : {Require : S {ssW .Start }},
ssW .SuperConnected : {Require : S {ssW .Start }},
ssW .ClientConnected : {Require : S {ssW .Start }},
ssW .Ready : {Require : S {ssW .LocalRpcReady }},
ssW .RpcReady : {
Auto : true ,
Require : S {ssW .LocalRpcReady , ssW .PublicRpcReady },
},
ssW .ServeClient : {Require : S {ssW .PublicRpcReady }},
ssW .ClientSendPayload : {
Require : S {ssW .PublicRpcReady },
},
ssW .SuperSendPayload : {
Require : S {ssW .LocalRpcReady },
},
ssW .SendPayload : {Add : S {ssW .ErrSendPayload , ssW .Exception }},
ssW .Idle : {
Auto : true ,
Require : S {ssW .Ready },
Remove : sgW .WorkStatus ,
},
ssW .WorkRequested : {
Require : S {ssW .Ready },
Remove : sgW .WorkStatus ,
},
ssW .Working : {
Require : S {ssW .Ready },
Remove : sgW .WorkStatus ,
},
ssW .WorkReady : {
Require : S {ssW .Ready },
Remove : sgW .WorkStatus ,
},
})
var (
ssW = am .NewStates (WorkerStatesDef {})
sgW = am .NewStateGroups (WorkerGroupsDef {
WorkStatus : S {ssW .WorkRequested , ssW .Working , ssW .WorkReady , ssW .Idle },
})
WorkerStates = ssW
WorkerGroups = sgW
)
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 .