Documentation
¶
Overview ¶
Package batchqueue resolves an AWS Batch job queue into the log sources of every job currently active in it — submitted, waiting, or running — tailing them all together and picking up newly submitted jobs as they arrive.
Unlike a single job or execution, a queue has no terminal state: work keeps arriving indefinitely, so Done is always nil. Discovery is driven by polling ListJobs across the active statuses and delegating each job id to a resolver/batch-style Resolver (WithBatchResolver), which handles the per-job/array-child log stream discovery and its own terminal polling.
Index ¶
Constants ¶
const Scheme = "batch-queue"
Scheme is the reference scheme this Resolver handles. A reference is a job queue name or ARN: "batch-queue:<queue>".
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API interface {
DescribeJobQueues(ctx context.Context, in *awsbatch.DescribeJobQueuesInput, optFns ...func(*awsbatch.Options)) (*awsbatch.DescribeJobQueuesOutput, error)
ListJobs(ctx context.Context, in *awsbatch.ListJobsInput, optFns ...func(*awsbatch.Options)) (*awsbatch.ListJobsOutput, error)
}
API is the slice of the AWS Batch client this resolver needs. The real *batch.Client satisfies it.
type Option ¶
type Option func(*Resolver)
Option configures a Resolver.
func WithBatchResolver ¶
WithBatchResolver wires a resolver/batch-style delegate. Its reference is a Batch job id. Required: without it Resolve always errors, since this package only enumerates the queue, it does not resolve job log sources itself.
func WithPollInterval ¶
WithPollInterval sets how often the queue is re-swept for newly submitted jobs. Values <= 0 are ignored. Defaults to 3s.
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver resolves a Batch job queue into the log sources of its active jobs.
func New ¶
New builds a batchqueue Resolver from an AWS Batch client. Pass WithBatchResolver to actually enable Resolve.
func (*Resolver) List ¶
List implements resolog.Lister, enumerating job queues whose name starts with filter (empty filter lists all). Resolve then takes one of the returned queue names.
func (*Resolver) Resolve ¶
Resolve implements resolog.Resolver. ref is a job queue name or ARN. It polls the queue's active jobs on an interval, delegating each newly seen job id to the configured batch resolver. Done is always nil: a queue is never terminal, so following runs until the caller cancels the context.