command

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCancelTimerCommand

func NewCancelTimerCommand(id int64, timerScheduleEventID int64) *cancelTimerCommand

func NewSideEffectCommand

func NewSideEffectCommand(id int64, result payload.Payload) *sideEffectCommand

Types

type CancelSubWorkflowCommand added in v0.4.0

type CancelSubWorkflowCommand struct {
	SubWorkflowInstance *core.WorkflowInstance
	// contains filtered or unexported fields
}

func NewCancelSubWorkflowCommand added in v0.1.0

func NewCancelSubWorkflowCommand(id int64, subWorkflowInstance *core.WorkflowInstance) *CancelSubWorkflowCommand

func (*CancelSubWorkflowCommand) Commit added in v0.4.0

func (*CancelSubWorkflowCommand) Done added in v0.4.0

func (c *CancelSubWorkflowCommand) Done()

func (*CancelSubWorkflowCommand) ID added in v0.4.0

func (c *CancelSubWorkflowCommand) ID() int64

func (*CancelSubWorkflowCommand) State added in v0.4.0

func (c *CancelSubWorkflowCommand) State() CommandState

func (*CancelSubWorkflowCommand) Type added in v0.4.0

type Command

type Command interface {
	ID() int64

	Commit(clock clock.Clock) *CommandResult

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

	State() CommandState

	Type() string
}

func NewScheduleActivityCommand added in v0.4.0

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

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_Done
)
┌───────┐
│Pending├
└───────┘
    ▼

┌─────────┐ │Committed│ └─────────┘

   ▼
┌────┐
│Done│
└────┘

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 (*CompleteWorkflowCommand) Done added in v0.4.0

func (c *CompleteWorkflowCommand) Done()

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

type ScheduleActivityCommand added in v0.4.0

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

func (*ScheduleActivityCommand) Commit added in v0.4.0

func (*ScheduleActivityCommand) Done added in v0.4.0

func (c *ScheduleActivityCommand) Done()

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

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) Commit added in v0.4.0

func (*ScheduleSubWorkflowCommand) Done added in v0.4.0

func (c *ScheduleSubWorkflowCommand) Done()

func (*ScheduleSubWorkflowCommand) ID added in v0.4.0

func (c *ScheduleSubWorkflowCommand) ID() int64

func (*ScheduleSubWorkflowCommand) State added in v0.4.0

func (c *ScheduleSubWorkflowCommand) State() CommandState

func (*ScheduleSubWorkflowCommand) Type added in v0.4.0

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) Commit added in v0.4.0

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

func (*ScheduleTimerCommand) Done added in v0.4.0

func (c *ScheduleTimerCommand) Done()

func (*ScheduleTimerCommand) ID added in v0.4.0

func (c *ScheduleTimerCommand) ID() int64

func (*ScheduleTimerCommand) State added in v0.4.0

func (c *ScheduleTimerCommand) State() CommandState

func (*ScheduleTimerCommand) Type added in v0.4.0

func (c *ScheduleTimerCommand) Type() string

Jump to

Keyboard shortcuts

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