Documentation
¶
Overview ¶
Package velocity is a set of Go 1.27 concurrency foundations. The root package holds only the version; the work is in the subpackages, chosen by the shape of the problem:
- ownership — deterministic cleanup and handoff for a value: when Drop runs, who may touch the value meanwhile, and transfer between goroutines. Borrow checks are an assertion layer, never a wait. Start with Own, NewCloser, Lease, Scope, or Frozen.
- pool — a bounded set of made, held, and returned resources; checkouts are ownership leases.
- async — bounded fan-out: a Runner states a Limit once and runs labeled tasks (Gather, Race, FirstSuccess), a function over a collection (Map, ForEach), workers over one owned value (Broadcast), or an ErrGroup that replaces x/sync/errgroup. Pipeline chains typed stages; Group tracks goroutines with panic recovery.
- dedupe — coalesces concurrent calls per key so one runs and every caller gets the result; results become owned handles only on request.
- resilience — Retry with classifiers, backoff, and an injectable Clock; a circuit Breaker that never waits; ManualClock for tests of either.
- opcodes, opruntime — plain data shapes for operations and a registry mapping them to Go functions. Not a VM.
- traits — the Drop and Clone function types ownership is configured with, composable as Drop(...).Clone(...).
The analysis module (a separate go.mod, so the library does not depend on x/tools) ships lostrelease, a go vet analyzer that reports an ownership borrow, lease, or pool checkout not released on every path.
Every package follows the same rules: nothing waits except where the caller's context governs it, errors are typed and unwrap to sentinels, callbacks return normally, and instrumentation is a Hooks struct the caller supplies rather than metrics the package keeps.
Index ¶
Constants ¶
const Version = "dev"
Version is the source version used by untagged development builds.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
analysis
module
|
|
|
Package async provides typed, bounded concurrent task execution, collection fan-out, pipelines, ownership-aware fan-out, and tracked goroutine lifecycles.
|
Package async provides typed, bounded concurrent task execution, collection fan-out, pipelines, ownership-aware fan-out, and tracked goroutine lifecycles. |
|
Package dedupe suppresses duplicate work and shares successful results through explicitly released ownership handles.
|
Package dedupe suppresses duplicate work and shares successful results through explicitly released ownership handles. |
|
failsafeown
module
|
|
|
Package opcodes defines plain data shapes for identifying an operation and its operands.
|
Package opcodes defines plain data shapes for identifying an operation and its operands. |
|
Package opruntime is glue: a registry mapping an opcodes.Op to the Go function that implements it, plus dispatch.
|
Package opruntime is glue: a registry mapping an opcodes.Op to the Go function that implements it, plus dispatch. |
|
Package ownership provides concurrency-safe runtime ownership and borrow-state checks for Go values.
|
Package ownership provides concurrency-safe runtime ownership and borrow-state checks for Go values. |
|
Package pool holds a bounded set of reusable resources — connections, buffers, handles — and checks them out as ownership leases, so returning one exactly once and never using it afterwards is enforced rather than hoped for.
|
Package pool holds a bounded set of reusable resources — connections, buffers, handles — and checks them out as ownership leases, so returning one exactly once and never using it afterwards is enforced rather than hoped for. |
|
Package resilience provides context-aware retry policies with classifiers, cancellation-aware backoff, circuit breakers, and injectable clocks.
|
Package resilience provides context-aware retry policies with classifiers, cancellation-aware backoff, circuit breakers, and injectable clocks. |
|
Package traits defines small, composable policies for copying and releasing values.
|
Package traits defines small, composable policies for copying and releasing values. |