Documentation
¶
Overview ¶
Package tasks is the public SDK facade over Harbor's internal/tasks package — the unified foreground/background TaskRegistry, the spawn vocabulary, and the task-group join surface (RFC §3.6, §6.3; D-204). Alias-based re-exports only: no behavior lives here. Event payload structs, the patch mechanism, and Protocol wire projections are deliberately private.
Index ¶
- Constants
- Variables
- type Dependencies
- type GroupCompletion
- type GroupRequest
- type MemberOutcome
- type SpawnRequest
- type SpawnToolRequest
- type Task
- type TaskError
- type TaskFilter
- type TaskGroup
- type TaskGroupID
- type TaskGroupStatus
- type TaskHandle
- type TaskID
- type TaskKind
- type TaskRegistry
- type TaskResult
- type TaskStatus
- type TaskSummary
Constants ¶
const ( // KindForeground — a foreground task. KindForeground = internal.KindForeground // KindBackground — a background task. KindBackground = internal.KindBackground )
TaskKind values.
const ( // StatusPending — spawned, not yet started. StatusPending = internal.StatusPending // StatusRunning — executing. StatusRunning = internal.StatusRunning // StatusPaused — parked on the pause primitive. StatusPaused = internal.StatusPaused // StatusComplete — terminal success. StatusComplete = internal.StatusComplete // StatusFailed — terminal failure. StatusFailed = internal.StatusFailed // StatusCancelled — terminal cancellation. StatusCancelled = internal.StatusCancelled )
TaskStatus values.
const ( // GroupOpen — accepting members. GroupOpen = internal.GroupOpen // GroupSealed — membership frozen. GroupSealed = internal.GroupSealed // GroupCompleted — terminal success. GroupCompleted = internal.GroupCompleted // GroupCancelled — terminal cancellation. GroupCancelled = internal.GroupCancelled )
TaskGroupStatus values.
const ( // PropagateCascade — cancelling the parent cancels spawned children. PropagateCascade = internal.PropagateCascade // PropagateIsolate — children survive the parent's cancellation. PropagateIsolate = internal.PropagateIsolate )
Cancellation propagation policies.
const DefaultDriver = internal.DefaultDriver
DefaultDriver is the driver name Open resolves when the config names none.
Variables ¶
var ( // ErrNotFound — no task under that ID. ErrNotFound = internal.ErrNotFound // ErrInvalidTransition — an illegal lifecycle transition. ErrInvalidTransition = internal.ErrInvalidTransition // ErrIdempotencyConflict — an idempotency key reused divergently. ErrIdempotencyConflict = internal.ErrIdempotencyConflict // ErrIdentityRequired — the identity triple is incomplete. ErrIdentityRequired = internal.ErrIdentityRequired // ErrUnknownDriver — the named task driver is not registered. ErrUnknownDriver = internal.ErrUnknownDriver // ErrRegistryClosed — the registry has been closed. ErrRegistryClosed = internal.ErrRegistryClosed // ErrInvalidRequest — the spawn request failed validation. ErrInvalidRequest = internal.ErrInvalidRequest // ErrGroupNotFound — no group under that ID. ErrGroupNotFound = internal.ErrGroupNotFound // ErrGroupSealed — a sealed group's membership cannot mutate. ErrGroupSealed = internal.ErrGroupSealed // ErrGroupNotSealed — resolve requires a sealed group. ErrGroupNotSealed = internal.ErrGroupNotSealed )
Re-exported sentinel errors callers compare via errors.Is.
var From = internal.From
From extracts the registry from ctx, reporting presence.
var MustFrom = internal.MustFrom
MustFrom extracts the registry from ctx, panicking when absent.
var Open = internal.Open
Open resolves the configured task driver and opens it.
var OpenDriver = internal.OpenDriver
OpenDriver opens a task driver by explicit name.
var RegisteredDrivers = internal.RegisteredDrivers
RegisteredDrivers lists the seated task driver names (blank-import sdk/drivers/prod to seat the production set).
var ValidateRequest = internal.ValidateRequest
ValidateRequest validates a SpawnRequest.
var WithRegistry = internal.WithRegistry
WithRegistry returns a child context carrying the registry.
Functions ¶
This section is empty.
Types ¶
type Dependencies ¶
type Dependencies = internal.Dependencies
Dependencies carries the registry's construction dependencies.
type GroupCompletion ¶
type GroupCompletion = internal.GroupCompletion
GroupCompletion is the resolved group's typed completion.
type GroupRequest ¶
type GroupRequest = internal.GroupRequest
GroupRequest describes one group creation.
type MemberOutcome ¶
type MemberOutcome = internal.MemberOutcome
MemberOutcome is one member's outcome inside a GroupCompletion.
type SpawnRequest ¶
type SpawnRequest = internal.SpawnRequest
SpawnRequest describes one task spawn.
type SpawnToolRequest ¶
type SpawnToolRequest = internal.SpawnToolRequest
SpawnToolRequest describes one background tool-call spawn.
type TaskGroupStatus ¶
type TaskGroupStatus = internal.TaskGroupStatus
TaskGroupStatus is the group lifecycle state.
type TaskRegistry ¶
type TaskRegistry = internal.TaskRegistry
TaskRegistry is the identity-mandatory task registry interface.
type TaskSummary ¶
type TaskSummary = internal.TaskSummary
TaskSummary is the compact list projection.