Documentation
¶
Overview ¶
Package auditqueue provides a bounded, asynchronous worker pool for audit work. Both the Valkey rate-store round-trip and the audit.Logger HTTP POST are blocking network calls that must never run on the Check() hot path, so they are submitted here as jobs and executed on worker goroutines.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Job ¶
Job is a unit of audit work executed on a worker goroutine. It receives a background context not tied to the (already-returned) request.
type Options ¶
type Options struct {
// Metrics records dropped jobs and queue depth. May be nil.
Metrics *metric.Metrics
// Size bounds the number of buffered jobs. Values < 1 default to 1.
Size int
// Workers is the number of draining goroutines. Values < 1 default to 1.
Workers int
// DispatchTimeout bounds how long a single job may run before its context
// is cancelled. Values <= 0 default to defaultDispatchTimeout.
DispatchTimeout time.Duration
}
Options configures a Queue.
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
Queue is a bounded async worker pool.
func (*Queue) Close ¶
Close stops accepting new jobs and drains those already queued before returning. It is safe to call more than once.
Click to show internal directories.
Click to hide internal directories.