command

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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) Committed added in v0.4.1

func (c *CancelSubWorkflowCommand) Committed() bool

func (*CancelSubWorkflowCommand) Done added in v0.4.0

func (c *CancelSubWorkflowCommand) Done()

Done marks the command as 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 CancelTimerCommand added in v0.4.1

type CancelTimerCommand struct {
	TimerScheduleEventID int64
	// contains filtered or unexported fields
}

func NewCancelTimerCommand

func NewCancelTimerCommand(id int64, timerScheduleEventID int64) *CancelTimerCommand

func (*CancelTimerCommand) Commit added in v0.4.1

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

func (*CancelTimerCommand) Committed added in v0.4.1

func (c *CancelTimerCommand) Committed() bool

func (*CancelTimerCommand) Done added in v0.4.1

func (c *CancelTimerCommand) Done()

Done marks the command as done

func (*CancelTimerCommand) ID added in v0.4.1

func (c *CancelTimerCommand) ID() int64

func (*CancelTimerCommand) State added in v0.4.1

func (c *CancelTimerCommand) State() CommandState

func (*CancelTimerCommand) Type added in v0.4.1

func (*CancelTimerCommand) Type() string

type Command

type Command interface {
	ID() int64

	Type() string

	State() CommandState

	Committed() bool

	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()
}

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│ - Command is pending, has just been added │ └───────┘ │ ▼ │ ┌─────────┐ │ │Committed│ - Command has been committed. Its results (e.g., events) have been checkpointed │ └─────────┘ │ ▼ │ ┌────┐ └──────►│Done│ - Command has been marked as 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) Committed added in v0.4.1

func (c *CompleteWorkflowCommand) Committed() bool

func (*CompleteWorkflowCommand) Done added in v0.4.0

func (c *CompleteWorkflowCommand) Done()

Done marks the command as 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) Committed added in v0.4.1

func (c *ScheduleActivityCommand) Committed() bool

func (*ScheduleActivityCommand) Done added in v0.4.0

func (c *ScheduleActivityCommand) Done()

Done marks the command as 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) Committed added in v0.4.1

func (c *ScheduleSubWorkflowCommand) Committed() bool

func (*ScheduleSubWorkflowCommand) Done added in v0.4.0

func (c *ScheduleSubWorkflowCommand) Done()

Done marks the command as 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) Committed added in v0.4.1

func (c *ScheduleTimerCommand) Committed() bool

func (*ScheduleTimerCommand) Done added in v0.4.0

func (c *ScheduleTimerCommand) Done()

Done marks the command as 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

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(clock clock.Clock) *CommandResult

func (*SideEffectCommand) Committed added in v0.4.1

func (c *SideEffectCommand) Committed() bool

func (*SideEffectCommand) Done added in v0.4.1

func (c *SideEffectCommand) Done()

Done marks the command as done

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(clock clock.Clock) *CommandResult

func (*SignalWorkflowCommand) Committed added in v0.5.0

func (c *SignalWorkflowCommand) Committed() bool

func (*SignalWorkflowCommand) Done added in v0.5.0

func (c *SignalWorkflowCommand) Done()

Done marks the command as done

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 (*SignalWorkflowCommand) Type() string

Jump to

Keyboard shortcuts

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