Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type PollOpts ¶
type PollOpts struct {
MaxTS time.Time `validate:"required"`
InitialInterval time.Duration `validate:"required"`
MaxInterval time.Duration `validate:"required"`
BackoffFactor float64 `validate:"required"`
// If set to > 0, Poll with return the ContinueAsNewErr after every N attempts.
ContinueAsNewAfterAttempts int `validate:"min=0"`
Fn PollerFn `validate:"required"`
PostAttemptHook func(workflow.Context, time.Duration) error
}
type PollerFn ¶
NOTE(jm): we use this pattern in many workflows, and while we do want to move to using signals to make it easier to control flow, this approach is still common.
Setting ContinueAsNewAfterAttempts to >0 will return ContinueAsNewErr after the given number of attempts. Use this to return workflow.ContinueAsNewErr to temporal for doing continue-as-new polling.
Click to show internal directories.
Click to hide internal directories.