Documentation ¶
Index ¶
- Constants
- Variables
- func MachineCollection(tree *hsm.Node) hsm.Collection[*Dummy]
- func RegisterExecutor(registry *hsm.Registry, taskExecutorOptions TaskExecutorOptions) error
- func RegisterStateMachine(r *hsm.Registry) error
- func RegisterTaskSerializers(reg *hsm.Registry) error
- type Dummy
- type Event0
- type Event1
- type ImmediateTask
- type ImmediateTaskSerializer
- type State
- type TaskExecutorOptions
- type TimerTask
- type TimerTaskSerializer
Constants ¶
View Source
const ( TaskTypeTimer = "dummy.Immediate" TaskTypeImmediate = "dummy.Timer" )
Variables ¶
View Source
var StateMachineType = "dummy.Dummy"
View Source
var Transition0 = hsm.NewTransition( []State{State0, State1}, State0, func(sm *Dummy, e Event0) (hsm.TransitionOutput, error) { return hsm.TransitionOutput{}, nil }, )
View Source
var Transition1 = hsm.NewTransition( []State{State0, State1}, State1, func(sm *Dummy, e Event1) (hsm.TransitionOutput, error) { return hsm.TransitionOutput{}, nil }, )
Functions ¶
func MachineCollection ¶
func MachineCollection(tree *hsm.Node) hsm.Collection[*Dummy]
func RegisterExecutor ¶
func RegisterExecutor( registry *hsm.Registry, taskExecutorOptions TaskExecutorOptions, ) error
func RegisterStateMachine ¶
func RegisterTaskSerializers ¶
Types ¶
type Dummy ¶
type Dummy struct {
CurrentState State
}
Dummy state machine. It's used for writing unit tests. Do not use in production!
type ImmediateTask ¶
type ImmediateTask struct {
Destination string
}
func (ImmediateTask) Concurrent ¶
func (ImmediateTask) Concurrent() bool
func (ImmediateTask) Kind ¶
func (t ImmediateTask) Kind() hsm.TaskKind
func (ImmediateTask) Type ¶
func (ImmediateTask) Type() string
type ImmediateTaskSerializer ¶
type ImmediateTaskSerializer struct{}
func (ImmediateTaskSerializer) Deserialize ¶
type TaskExecutorOptions ¶
type TaskExecutorOptions struct { ImmediateExecutor hsm.ImmediateExecutor[ImmediateTask] TimerExecutor hsm.TimerExecutor[TimerTask] }
type TimerTask ¶
func (TimerTask) Concurrent ¶
type TimerTaskSerializer ¶
type TimerTaskSerializer struct{}
func (TimerTaskSerializer) Deserialize ¶
Click to show internal directories.
Click to hide internal directories.