Versions in this module Expand all Collapse all v0 v0.1.6 Nov 26, 2026 Changes in this version type Settlement + CleanupClass FailureClass + func (settlement Settlement) LocalCleanupError() error v0.1.5 Nov 22, 2026 v0.1.4 Nov 19, 2026 v0.1.3 Nov 18, 2026 v0.1.2 Nov 18, 2026 Changes in this version + var ErrApplicationClosed = errors.New("application closed") + var ErrCancelled = errors.New("task cancelled") + var ErrInvalidSettlement = errors.New("task result violates its settlement contract") + var ErrShareStopped = errors.New("share explicitly stopped") + type Completion struct + Value T + type Config struct + CleanupTimeout time.Duration + Completed func(error) + Diagnostics diagnostics.Sink + ID ID + Now func() time.Time + ObservationCapacity observationstream.Capacity + Project func(Observation, func(Observation) bool) bool + Random io.Reader + Run func(context.Context, Control) Completion[T] + type Control struct + CleanupContext func() (context.Context, context.CancelFunc) + Diagnostics diagnostics.Sink + Emit func(Event) bool + ID ID + Now func() time.Time + Random io.Reader + StateChanged func() + func (control Control) NotifyStateChanged() + type Event interface + EngineEvent func() + type FailureClass uint8 + const FailureLocal + const FailureNetwork + const FailureNone + const FailureSourceDrift + const FailureUsage + type ID string + type Lifecycle struct + State State + StopReason StopReason + func (Lifecycle) EngineEvent() + type Observation struct + At time.Time + Event Event + TaskID ID + type Outcome uint8 + const OutcomeCancelled + const OutcomeFailed + const OutcomePartial + const OutcomePaused + const OutcomeStopped + const OutcomeSuccess + type Result struct + FinishedAt time.Time + Observations observationstream.Completion + StartedAt time.Time + StopReason StopReason + type Settlement struct + CleanupError error + CleanupFailure appobs.Failure + Err error + Failure appobs.Failure + FailureClass FailureClass + Outcome Outcome + func (settlement Settlement) Checked() Settlement + func (settlement Settlement) Valid() bool + type State uint8 + const Finished + const Running + const Stopping + type StopReason uint8 + const ApplicationClosed + const Cancelled + const NoStop + const ShareStopped + func Reason(ctx context.Context) StopReason + type Task struct + func Start[T any](parent context.Context, config Config[T]) (*Task[T], error) + func (current *Task[T]) Cancel() + func (current *Task[T]) Changes() <-chan struct{} + func (current *Task[T]) Done() <-chan struct{} + func (current *Task[T]) ID() ID + func (current *Task[T]) Observations() <-chan Observation + func (current *Task[T]) State() State + func (current *Task[T]) Stop(reason StopReason) + func (current *Task[T]) Wait(ctx context.Context) (Result[T], error)