Documentation
¶
Index ¶
- Constants
- func MigrationStatus(ctx context.Context, root *sconfig.Root) migration.Status
- func RunMigrations(ctx context.Context, root *sconfig.Root, logger *slog.Logger, ...) error
- type Client
- type MigrateOption
- type Runtime
- func (r *Runtime) Backend() wfbackend.Backend
- func (r *Runtime) Client() Client
- func (r *Runtime) Close() error
- func (r *Runtime) CreateWorkflowInstance(ctx context.Context, options client.WorkflowInstanceOptions, ...) (*wflib.Instance, error)
- func (r *Runtime) DiagnosticBackend() (diag.Backend, error)
- func (r *Runtime) GetWorkflowInstanceHistory(ctx context.Context, instance *wflib.Instance, lastSequenceID *int64) ([]*history.Event, error)
- func (r *Runtime) GetWorkflowInstanceState(ctx context.Context, instance *wflib.Instance) (wfcore.WorkflowInstanceState, error)
- func (r *Runtime) Ping(ctx context.Context) bool
- func (r *Runtime) RemoveWorkflowInstances(ctx context.Context, options ...wfbackend.RemovalOption) error
- type RuntimeOption
- type TaskHandler
- type Worker
Constants ¶
View Source
const (
DefaultQueue = wflib.QueueDefault
)
Variables ¶
This section is empty.
Functions ¶
func MigrationStatus ¶
MigrationStatus returns the status of the workflow database migrations.
Types ¶
type Client ¶
type Client interface {
CreateWorkflowInstance(
ctx context.Context,
options client.WorkflowInstanceOptions,
workflow wflib.Workflow,
args ...any,
) (*wflib.Instance, error)
GetWorkflowInstanceState(
ctx context.Context,
instance *wflib.Instance,
) (wfcore.WorkflowInstanceState, error)
GetWorkflowInstanceHistory(
ctx context.Context,
instance *wflib.Instance,
lastSequenceID *int64,
) ([]*history.Event, error)
}
type MigrateOption ¶
type MigrateOption func(*migrateOptions)
func WithPostgresMigrationDB ¶
func WithPostgresMigrationDB(db *sql.DB) MigrateOption
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
func NewRuntime ¶
func NewRuntime( root *sconfig.Root, telemetry *aptelemetry.Providers, logger *slog.Logger, opts ...RuntimeOption, ) (*Runtime, error)
func (*Runtime) CreateWorkflowInstance ¶
func (*Runtime) GetWorkflowInstanceHistory ¶
func (*Runtime) GetWorkflowInstanceState ¶
func (*Runtime) RemoveWorkflowInstances ¶
func (r *Runtime) RemoveWorkflowInstances(ctx context.Context, options ...wfbackend.RemovalOption) error
RemoveWorkflowInstances permanently deletes finished workflow instances and their history that match options.
type RuntimeOption ¶
type RuntimeOption func(*runtimeOptions)
func WithPostgresDB ¶
func WithPostgresDB(db *sql.DB) RuntimeOption
type TaskHandler ¶
type TaskHandler struct {
// contains filtered or unexported fields
}
TaskHandler owns the Asynq maintenance tasks for the workflow runtime. It is registered with the worker's mux and scheduler like the other task handlers.
func NewTaskHandler ¶
NewTaskHandler creates the handler for workflow maintenance tasks. cfg may be nil, in which case the default retention applies.
func (*TaskHandler) GetCronTasks ¶
func (h *TaskHandler) GetCronTasks() []*asynq.PeriodicTaskConfig
GetCronTasks returns the daily cleanup of finished workflow instances, or nothing when retention is disabled.
func (*TaskHandler) RegisterTasks ¶
func (h *TaskHandler) RegisterTasks(mux *asynq.ServeMux)
RegisterTasks registers the workflow maintenance task handlers with the Asynq mux.
type Worker ¶
type Worker struct {
// contains filtered or unexported fields
}
func (*Worker) RegisterActivity ¶
func (*Worker) RegisterWorkflow ¶
func (*Worker) WaitForCompletion ¶
Click to show internal directories.
Click to hide internal directories.