Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DurableTaskDeclaration ¶
type DurableTaskDeclaration[I any] struct { TaskBase NamedTaskImpl // The friendly name of the task Name string // The tasks that must successfully complete before this task can start Parents []string // Concurrency defines constraints on how many instances of this task can run simultaneously // and group key expression to evaluate when determining if a task can run Concurrency []*types.Concurrency // WaitFor represents a set of conditions which must be satisfied before the task can run. WaitFor condition.Condition // SkipIf represents a set of conditions which, if satisfied, will cause the task to be skipped. SkipIf condition.Condition // CancelIf represents a set of conditions which, if satisfied, will cause the task to be canceled. CancelIf condition.Condition // The function to execute when the task runs // must be a function that takes an input and a DurableHatchetContext and returns an output and an error Fn interface{} }
DurableTaskDeclaration represents a durable task configuration that can be added to a workflow. Durable tasks can use the DurableHatchetContext for operations that persist across worker restarts.
func (*DurableTaskDeclaration[I]) Dump ¶
func (t *DurableTaskDeclaration[I]) Dump(workflowName string, taskDefaults *create.TaskDefaults) *contracts.CreateTaskOpts
func (*DurableTaskDeclaration[I]) GetName ¶
func (t *DurableTaskDeclaration[I]) GetName() string
Implement GetName for DurableTaskDeclaration
type NamedTaskImpl ¶
type NamedTaskImpl struct {
Name string
}
func (*NamedTaskImpl) GetName ¶
func (t *NamedTaskImpl) GetName() string
Implement GetName for NamedTask
type OnFailureTaskDeclaration ¶
type OnFailureTaskDeclaration[I any] struct { TaskBase // The function to execute when any tasks in the workflow have failed Fn interface{} }
OnFailureTaskDeclaration represents a task that will be executed if any tasks in the workflow fail.
func (*OnFailureTaskDeclaration[I]) Dump ¶
func (t *OnFailureTaskDeclaration[I]) Dump(workflowName string, taskDefaults *create.TaskDefaults) *contracts.CreateTaskOpts
Dump converts the on failure task declaration into a protobuf request.
type TaskBase ¶
type TaskBase interface {
Dump(workflowName string, taskDefaults *create.TaskDefaults) *contracts.CreateTaskOpts
}
type TaskDeclaration ¶
type TaskDeclaration[I any] struct { TaskBase NamedTaskImpl // The friendly name of the task Name string // The tasks that must successfully complete before this task can start Parents []string // WaitFor represents a set of conditions which must be satisfied before the task can run. WaitFor condition.Condition // SkipIf represents a set of conditions which, if satisfied, will cause the task to be skipped. SkipIf condition.Condition // CancelIf represents a set of conditions which, if satisfied, will cause the task to be canceled. CancelIf condition.Condition // The function to execute when the task runs // must be a function that takes an input and a Hatchet context and returns an output and an error Fn interface{} }
TaskDeclaration represents a standard (non-durable) task configuration that can be added to a workflow.
func (*TaskDeclaration[I]) Dump ¶
func (t *TaskDeclaration[I]) Dump(workflowName string, taskDefaults *create.TaskDefaults) *contracts.CreateTaskOpts
Dump converts the task declaration into a protobuf request.
func (*TaskDeclaration[I]) GetName ¶
func (t *TaskDeclaration[I]) GetName() string
Implement GetName for TaskDeclaration
type TaskShared ¶
type TaskShared struct {
ExecutionTimeout *time.Duration
ScheduleTimeout *time.Duration
Retries *int32
RetryBackoffFactor *float32
RetryMaxBackoffSeconds *int32
RateLimits []*types.RateLimit
WorkerLabels map[string]*types.DesiredWorkerLabel
Concurrency []*types.Concurrency
// must be a function that takes an input and a Hatchet context and returns an output and an error
Fn interface{}
}