Documentation
¶
Overview ¶
Package inprocess is Harbor's V1 in-process TaskRegistry driver. It is the test reference for the conformance suite — every later driver (post-V1 durable queue, e.g. NATS or Postgres-as-queue at Phase 87) inherits the same suite verbatim.
Internal model:
- A primary `map[TaskID]*Task` holds the live task state.
- A secondary `map[idempotencyKey]TaskID` resolves `(SessionID, IdempotencyKey)` lookups for `Spawn` dedup.
- A children index `map[TaskID][]TaskID` powers cascade-cancel BFS without scanning the primary map.
- A single `sync.RWMutex` guards all three maps. The driver does no I/O so contention is bounded by Go's map throughput; a finer-grained lock structure would be premature.
- Every lifecycle transition writes through `state.StateStore` (the typed-wrapper-over-generic adapter, D-027) and emits a typed `events.EventPayload` on the bus.
- Caller-controlled strings (Description, Query, Result.Value, Error.Message) are run through the `audit.Redactor` BEFORE the Save (D-020). The redactor's reflective walk returns a `map[string]any`; we read the redacted strings back and replace them on the Task before marshalling.
- `Close(ctx)` flips an atomic flag; subsequent calls return `ErrRegistryClosed`. There are no driver-owned goroutines to join, so Close is fast.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(deps tasks.Dependencies) (tasks.TaskRegistry, error)
New constructs a TaskRegistry directly. Exposed for tests that want to skip the registry; production callers go through `tasks.Open`.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.