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.Timer" TaskTypeImmediate = "dummy.Immediate" )
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 {
// contains filtered or unexported fields
}
func (ImmediateTask) Deadline ¶ added in v1.26.2
func (ImmediateTask) Deadline() time.Time
func (ImmediateTask) Destination ¶
func (t ImmediateTask) Destination() string
func (ImmediateTask) Type ¶
func (ImmediateTask) Type() string
func (ImmediateTask) Validate ¶ added in v1.26.2
func (ImmediateTask) Validate(ref *persistencespb.StateMachineRef, node *hsm.Node) error
type ImmediateTaskSerializer ¶
type ImmediateTaskSerializer struct{}
func (ImmediateTaskSerializer) Deserialize ¶
func (ImmediateTaskSerializer) Deserialize(data []byte, attrs hsm.TaskAttributes) (hsm.Task, error)
type TaskExecutorOptions ¶
type TaskExecutorOptions struct { ImmediateExecutor hsm.ImmediateExecutor[ImmediateTask] TimerExecutor hsm.TimerExecutor[TimerTask] }
type TimerTask ¶
type TimerTask struct {
// contains filtered or unexported fields
}
func (TimerTask) Destination ¶ added in v1.26.2
func (TimerTask) Validate ¶ added in v1.26.0
func (t TimerTask) Validate(ref *persistencespb.StateMachineRef, node *hsm.Node) error
type TimerTaskSerializer ¶
type TimerTaskSerializer struct{}
func (TimerTaskSerializer) Deserialize ¶
func (TimerTaskSerializer) Deserialize(data []byte, attrs hsm.TaskAttributes) (hsm.Task, error)
Click to show internal directories.
Click to hide internal directories.