无状态
直接在Go代码中创建状态机和基于轻量级状态机的工作流:
phoneCall := stateless . NewStateMachine ( stateOffHook )
phoneCall . Configure ( stateOffHook ). Permit ( triggerCallDialed , stateRinging )
phoneCall . Configure ( stateRinging ).
OnEntryFrom ( triggerCallDialed , func ( _ context. Context , args ... interface {}) error {
onDialed ( args [ 0 ].( string ))
return nil
}).
Permit ( triggerCallConnected
1