timers

package
v1.16.2 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FixTimerCommandFromActivityOutput

func FixTimerCommandFromActivityOutput(now time.Time, request iwfidl.CommandRequest) iwfidl.CommandRequest

FixTimerCommandFromActivityOutput converts the durationSeconds to firingUnixTimestampSeconds doing it right after the activity output so that we don't need to worry about the time drift after continueAsNew

Types

type GreedyTimerProcessor

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

func NewGreedyTimerProcessor

func NewGreedyTimerProcessor(
	ctx interfaces.UnifiedContext,
	provider interfaces.WorkflowProvider,
	continueAsNewCounter *cont.ContinueAsNewCounter,
	staleSkipTimerSignals []service.StaleSkipTimerSignal,
) *GreedyTimerProcessor

func (*GreedyTimerProcessor) AddTimers

func (t *GreedyTimerProcessor) AddTimers(
	stateExeId string, commands []iwfidl.TimerCommand, completedTimerCmds map[int]service.InternalTimerStatus,
)

func (*GreedyTimerProcessor) Dump

func (*GreedyTimerProcessor) GetTimerInfos

func (t *GreedyTimerProcessor) GetTimerInfos() map[string][]*service.TimerInfo

func (*GreedyTimerProcessor) GetTimerStartedUnixTimestamps

func (t *GreedyTimerProcessor) GetTimerStartedUnixTimestamps() []int64

func (*GreedyTimerProcessor) RemovePendingTimersOfState

func (t *GreedyTimerProcessor) RemovePendingTimersOfState(stateExeId string)

RemovePendingTimersOfState is for when a state is completed, remove all its pending pendingScheduling

func (*GreedyTimerProcessor) RetryStaleSkipTimer

func (t *GreedyTimerProcessor) RetryStaleSkipTimer() bool

func (*GreedyTimerProcessor) SkipTimer

func (t *GreedyTimerProcessor) SkipTimer(stateExeId, timerId string, timerIdx int) bool

SkipTimer will attempt to skip a timer, return false if no valid timer found

func (*GreedyTimerProcessor) WaitForTimerFiredOrSkipped

func (t *GreedyTimerProcessor) WaitForTimerFiredOrSkipped(
	ctx interfaces.UnifiedContext, stateExeId string, timerIdx int, cancelWaiting *bool,
) service.InternalTimerStatus

WaitForTimerFiredOrSkipped waits for timer completed(fired or skipped), return true when the timer is fired or skipped return false if the waitingCommands is canceled by cancelWaiting bool pointer(when the trigger type is completed, or continueAsNew)

type SimpleTimerProcessor

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

func NewSimpleTimerProcessor

func NewSimpleTimerProcessor(
	ctx interfaces.UnifiedContext, provider interfaces.WorkflowProvider, staleSkipTimerSignals []service.StaleSkipTimerSignal,
) *SimpleTimerProcessor

func (*SimpleTimerProcessor) AddTimers

func (t *SimpleTimerProcessor) AddTimers(
	stateExeId string, commands []iwfidl.TimerCommand, completedTimerCmds map[int]service.InternalTimerStatus,
)

func (*SimpleTimerProcessor) Dump

func (*SimpleTimerProcessor) GetTimerInfos

func (t *SimpleTimerProcessor) GetTimerInfos() map[string][]*service.TimerInfo

func (*SimpleTimerProcessor) GetTimerStartedUnixTimestamps

func (t *SimpleTimerProcessor) GetTimerStartedUnixTimestamps() []int64

func (*SimpleTimerProcessor) RemovePendingTimersOfState

func (t *SimpleTimerProcessor) RemovePendingTimersOfState(stateExeId string)

RemovePendingTimersOfState is for when a state is completed, remove all its pending timers

func (*SimpleTimerProcessor) RetryStaleSkipTimer

func (t *SimpleTimerProcessor) RetryStaleSkipTimer() bool

func (*SimpleTimerProcessor) SkipTimer

func (t *SimpleTimerProcessor) SkipTimer(stateExeId, timerId string, timerIdx int) bool

SkipTimer will attempt to skip a timer, return false if no valid timer found

func (*SimpleTimerProcessor) WaitForTimerFiredOrSkipped

func (t *SimpleTimerProcessor) WaitForTimerFiredOrSkipped(
	ctx interfaces.UnifiedContext, stateExeId string, timerIdx int, cancelWaiting *bool,
) service.InternalTimerStatus

WaitForTimerFiredOrSkipped waits for timer completed(fired or skipped), return true when the timer is fired or skipped return false if the waitingCommands is canceled by cancelWaiting bool pointer(when the trigger type is completed, or continueAsNew)

Jump to

Keyboard shortcuts

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