Versions in this module Expand all Collapse all v0 v0.1.1 Sep 6, 2026 Changes in this version type TaskInfo + func ListStaleTasks(ctx context.Context, store Store, staleSince time.Duration) ([]TaskInfo, error) v0.1.0 Sep 6, 2026retracted Changes in this version + func Run[I, O any](ctx context.Context, h *TaskHandle, input I, task Task[I, O]) (O, error) + func Step[O any](ctx context.Context, s *StepRunner, stepID string, ...) (O, error) + type Client struct + func NewClient(ctx context.Context, store Store, opts ...Option) (*Client, error) + func (c *Client) Close() error + func (c *Client) NewTask(id string, opts ...TaskOption) *TaskHandle + type Option func(*config) + func WithAutoPurge(age time.Duration, interval ...time.Duration) Option + func WithLogger(logger *slog.Logger) Option + type StepRecord struct + CompletedAt time.Time + Error string + InputHash string + PanicTrace string + Result []byte + Seq int + StartedAt time.Time + Status StepStatus + StepID string + type StepRunner struct + type StepStatus string + const StepStatusCompleted + const StepStatusFailed + const StepStatusPending + type Store interface + DeleteTask func(ctx context.Context, taskID string) error + GetTask func(ctx context.Context, taskID string) (TaskInfo, bool, error) + ListStepIDs func(ctx context.Context, taskID string) ([]string, error) + ListTasks func(ctx context.Context) ([]TaskInfo, error) + LoadStep func(ctx context.Context, taskID, stepID string) (StepRecord, bool, error) + LoadSteps func(ctx context.Context, taskID string) ([]StepRecord, error) + PurgeTasks func(ctx context.Context, status TaskStatus, before time.Time) (int64, error) + SaveStep func(ctx context.Context, taskID string, step StepRecord) error + SaveTask func(ctx context.Context, task TaskInfo) error + type Task interface + Exec func(ctx context.Context, s *StepRunner, input I) (O, error) + type TaskFunc func(ctx context.Context, s *StepRunner, input I) (O, error) + func Func[I, O any](fn func(ctx context.Context, s *StepRunner, in I) (O, error)) TaskFunc[I, O] + func (f TaskFunc[I, O]) Exec(ctx context.Context, s *StepRunner, input I) (O, error) + type TaskHandle struct + func (h *TaskHandle) ID() string + type TaskInfo struct + CompletedAt time.Time + CreatedAt time.Time + Error string + ID string + Name string + PanicTrace string + StartedAt time.Time + Status TaskStatus + Tags map[string]string + UpdatedAt time.Time + type TaskOption func(*taskConfig) + func WithMaxRetries(n int) TaskOption + func WithName(name string) TaskOption + func WithTag(k, v string) TaskOption + func WithTimeout(d time.Duration) TaskOption + type TaskStatus string + const StatusCompleted + const StatusFailed + const StatusPending + const StatusRunning