Documentation
¶
Index ¶
- Variables
- func CreateSubWorkflowInstance(ctx sync.Context, options SubWorkflowOptions, workflow Workflow, ...) sync.Future
- func ExecuteActivity(ctx sync.Context, options ActivityOptions, activity Activity, ...) sync.Future
- func NewSignalChannel(ctx sync.Context, name string) sync.Channel
- func NewWorkflow(workflowFn reflect.Value) *workflow
- func Now(ctx sync.Context) time.Time
- func Replaying(ctx sync.Context) bool
- func ScheduleTimer(ctx sync.Context, delay time.Duration) sync.Future
- func SetReplaying(ctx sync.Context, replaying bool)
- func SideEffect(ctx sync.Context, f func(ctx sync.Context) interface{}) sync.Future
- func Sleep(ctx sync.Context, d time.Duration) error
- func WithRetries(ctx sync.Context, retryOptions RetryOptions, ...) sync.Future
- func WorkflowInstance2(ctx sync.Context) core.WorkflowInstance
- type Activity
- type ActivityOptions
- type Registry
- type RetryOptions
- type SubWorkflowOptions
- type Workflow
- type WorkflowExecutor
- type WorkflowExecutorCache
- type WorkflowExecutorCacheOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultActivityOptions = ActivityOptions{ RetryOptions: DefaultRetryOptions, }
View Source
var DefaultRetryOptions = RetryOptions{
MaxAttempts: 3,
BackoffCoefficient: 1,
}
View Source
var DefaultSubWorkflowOptions = SubWorkflowOptions{ RetryOptions: DefaultRetryOptions, }
View Source
var DefaultWorkflowExecutorCacheOptions = WorkflowExecutorCacheOptions{ CacheDuration: 30 * time.Second, }
Functions ¶
func ExecuteActivity ¶
func ExecuteActivity(ctx sync.Context, options ActivityOptions, activity Activity, args ...interface{}) sync.Future
ExecuteActivity schedules the given activity to be executed
func NewWorkflow ¶
func SetReplaying ¶
func SideEffect ¶
func WithRetries ¶
func WorkflowInstance2 ¶
func WorkflowInstance2(ctx sync.Context) core.WorkflowInstance
Types ¶
type ActivityOptions ¶
type ActivityOptions struct {
RetryOptions RetryOptions
}
type Registry ¶
func NewRegistry ¶
func NewRegistry() *Registry
func (*Registry) RegisterActivity ¶
func (*Registry) RegisterWorkflow ¶
type RetryOptions ¶
type RetryOptions struct {
// Maximum number of times to retry
MaxAttempts int
// Time to wait before first retry
FirstRetryInterval time.Duration
// Maximum delay for any individual retry attempt
MaxRetryInterval time.Duration
// Coeffecient for calculation the next retry delay
BackoffCoefficient float64
// Timeout after which retries are aborted
RetryTimeout time.Duration
}
type SubWorkflowOptions ¶
type SubWorkflowOptions struct {
InstanceID string
RetryOptions RetryOptions
}
type WorkflowExecutor ¶
type WorkflowExecutor interface {
ExecuteTask(ctx context.Context, t *task.Workflow) ([]history.Event, []history.WorkflowEvent, error)
Close()
}
func NewExecutor ¶
func NewExecutor(registry *Registry, instance core.WorkflowInstance, clock clock.Clock) (WorkflowExecutor, error)
type WorkflowExecutorCache ¶
type WorkflowExecutorCache interface {
Store(ctx context.Context, instance core.WorkflowInstance, workflow WorkflowExecutor) error
Get(ctx context.Context, instance core.WorkflowInstance) (WorkflowExecutor, bool, error)
StartEviction(ctx context.Context)
}
func NewWorkflowExecutorCache ¶
func NewWorkflowExecutorCache(options WorkflowExecutorCacheOptions) WorkflowExecutorCache
Click to show internal directories.
Click to hide internal directories.