Documentation
¶
Overview ¶
Package workq is a minimal bounded worker pool for fire-and-forget background work (e.g. post-upload indexing). Jobs carry a context derived from the pool's root context; Close() cancels that context and waits for workers to drain, honouring the caller's deadline.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrClosed = errors.New("workq: closed")
ErrClosed is returned by Submit after Close has been called.
var ErrQueueFull = errors.New("workq: queue full")
ErrQueueFull is returned by Submit when the job queue is saturated. Callers should surface this as 503 Service Unavailable with Retry-After.
Functions ¶
This section is empty.
Types ¶
type Config ¶
Config sizes the pool. Zero values use safe defaults (1 worker, 16-deep queue). Total in-flight + queued capacity is Workers + QueueDepth.
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
Pool is a fixed-size worker pool with a bounded submission queue.