command

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 16, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CancelableCommand added in v0.5.1

type CancelableCommand interface {
	Command

	// Cancel cancels the command.
	Cancel()

	// HandleCancel handles a cancel event during replay
	HandleCancel()
}

type Command

type Command interface {
	ID() int64

	Type() string

	// State returns the current state of the command.
	State() CommandState

	// Execute processes the command in its current state and moves it to the next state.
	Execute(clock.Clock) *CommandResult

	// Commit marks the command as committed without executing it.
	Commit()

	// Done marks the command as done. This transitions the state to done and indicates that the result
	// of this command has been applied.
	Done()
}

type CommandResult added in v0.4.0

type CommandResult struct {
	Completed      bool
	Events         []history.Event
	ActivityEvents []history.Event
	TimerEvents    []history.Event
	WorkflowEvents []history.WorkflowEvent
}

type CommandState

type CommandState int
const (
	CommandState_Pending CommandState = iota
	CommandState_Committed
	CommandState_CancelPending
	CommandState_Canceled
	CommandState_Done
)

func (CommandState) String added in v0.5.1

func (cs CommandState) String() string

type CompleteWorkflowCommand added in v0.4.0

type CompleteWorkflowCommand struct {
	Instance *core.WorkflowInstance
	Result   payload.Payload
	Error    string
	// contains filtered or unexported fields
}

func NewCompleteWorkflowCommand

func NewCompleteWorkflowCommand(id int64, instance *core.WorkflowInstance, result payload.Payload, err error) *CompleteWorkflowCommand

func (*CompleteWorkflowCommand) Commit added in v0.4.0

func (c *CompleteWorkflowCommand) Commit()

func (*CompleteWorkflowCommand) Done added in v0.4.0

func (c *CompleteWorkflowCommand) Done()

func (*CompleteWorkflowCommand) Execute added in v0.5.1

func (c *CompleteWorkflowCommand) Execute(clock clock.Clock) *CommandResult

func (*CompleteWorkflowCommand) ID added in v0.4.0

func (c *CompleteWorkflowCommand) ID() int64

func (*CompleteWorkflowCommand) State added in v0.4.0

func (c *CompleteWorkflowCommand) State() CommandState

func (*CompleteWorkflowCommand) Type added in v0.4.0

func (c *CompleteWorkflowCommand) Type() string

type ScheduleActivityCommand added in v0.4.0

type ScheduleActivityCommand struct {
	Name   string
	Inputs []payload.Payload
	// contains filtered or unexported fields
}

func NewScheduleActivityCommand added in v0.4.0

func NewScheduleActivityCommand(id int64, name string, inputs []payload.Payload) *ScheduleActivityCommand

func (*ScheduleActivityCommand) Commit added in v0.4.0

func (c *ScheduleActivityCommand) Commit()

func (*ScheduleActivityCommand) Done added in v0.4.0

func (c *ScheduleActivityCommand) Done()

func (*ScheduleActivityCommand) Execute added in v0.5.1

func (c *ScheduleActivityCommand) Execute(clock clock.Clock) *CommandResult

func (*ScheduleActivityCommand) ID added in v0.4.0

func (c *ScheduleActivityCommand) ID() int64

func (*ScheduleActivityCommand) State added in v0.4.0

func (c *ScheduleActivityCommand) State() CommandState

func (*ScheduleActivityCommand) Type added in v0.4.0

func (c *ScheduleActivityCommand) Type() string

type ScheduleSubWorkflowCommand added in v0.4.0

type ScheduleSubWorkflowCommand struct {
	Instance *core.WorkflowInstance
	Metadata *core.WorkflowMetadata

	Name   string
	Inputs []payload.Payload
	// contains filtered or unexported fields
}

func NewScheduleSubWorkflowCommand

func NewScheduleSubWorkflowCommand(
	id int64, parentInstance *core.WorkflowInstance, subWorkflowInstanceID, name string, inputs []payload.Payload, metadata *core.WorkflowMetadata,
) *ScheduleSubWorkflowCommand

func (*ScheduleSubWorkflowCommand) Cancel added in v0.5.1

func (c *ScheduleSubWorkflowCommand) Cancel()

func (*ScheduleSubWorkflowCommand) Done added in v0.4.0

func (c *ScheduleSubWorkflowCommand) Done()

func (*ScheduleSubWorkflowCommand) Execute added in v0.5.1

func (*ScheduleSubWorkflowCommand) HandleCancel added in v0.5.1

func (c *ScheduleSubWorkflowCommand) HandleCancel()

type ScheduleTimerCommand added in v0.4.0

type ScheduleTimerCommand struct {
	// contains filtered or unexported fields
}

func NewScheduleTimerCommand

func NewScheduleTimerCommand(id int64, at time.Time) *ScheduleTimerCommand

func (*ScheduleTimerCommand) Cancel added in v0.5.1

func (c *ScheduleTimerCommand) Cancel()

func (*ScheduleTimerCommand) Done added in v0.4.0

func (c *ScheduleTimerCommand) Done()

func (*ScheduleTimerCommand) Execute added in v0.5.1

func (c *ScheduleTimerCommand) Execute(clock clock.Clock) *CommandResult

func (*ScheduleTimerCommand) HandleCancel added in v0.5.1

func (c *ScheduleTimerCommand) HandleCancel()

type SideEffectCommand added in v0.4.1

type SideEffectCommand struct {
	// contains filtered or unexported fields
}

func NewSideEffectCommand

func NewSideEffectCommand(id int64) *SideEffectCommand

func (*SideEffectCommand) Commit added in v0.4.1

func (c *SideEffectCommand) Commit()

func (*SideEffectCommand) Done added in v0.4.1

func (c *SideEffectCommand) Done()

func (*SideEffectCommand) Execute added in v0.5.1

func (c *SideEffectCommand) Execute(clock clock.Clock) *CommandResult

func (*SideEffectCommand) ID added in v0.4.1

func (c *SideEffectCommand) ID() int64

func (*SideEffectCommand) SetResult added in v0.5.0

func (c *SideEffectCommand) SetResult(result payload.Payload)

func (*SideEffectCommand) State added in v0.4.1

func (c *SideEffectCommand) State() CommandState

func (*SideEffectCommand) Type added in v0.4.1

func (c *SideEffectCommand) Type() string

type SignalWorkflowCommand added in v0.5.0

type SignalWorkflowCommand struct {
	Instance *core.WorkflowInstance

	Name string
	Arg  payload.Payload
	// contains filtered or unexported fields
}

func NewSignalWorkflowCommand added in v0.5.0

func NewSignalWorkflowCommand(
	id int64, workflowInstanceID, name string, arg payload.Payload,
) *SignalWorkflowCommand

func (*SignalWorkflowCommand) Commit added in v0.5.0

func (c *SignalWorkflowCommand) Commit()

func (*SignalWorkflowCommand) Done added in v0.5.0

func (c *SignalWorkflowCommand) Done()

func (*SignalWorkflowCommand) Execute added in v0.5.1

func (c *SignalWorkflowCommand) Execute(clock clock.Clock) *CommandResult

func (*SignalWorkflowCommand) ID added in v0.5.0

func (c *SignalWorkflowCommand) ID() int64

func (*SignalWorkflowCommand) State added in v0.5.0

func (c *SignalWorkflowCommand) State() CommandState

func (*SignalWorkflowCommand) Type added in v0.5.0

func (c *SignalWorkflowCommand) Type() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL