MCPcopy
hub / github.com/grafana/tempo / New

Function New

modules/distributor/queue/queue.go:61–76  ·  view source on GitHub ↗
(cfg Config, logger log.Logger, fn ProcessFunc[T])

Source from the content-addressed store, hash-verified

59}
60
61func New[T any](cfg Config, logger log.Logger, fn ProcessFunc[T]) *Queue[T] {
62 return &Queue[T]{
63 logger: logger,
64 name: cfg.Name,
65 tenantID: cfg.TenantID,
66 workerCount: cfg.WorkerCount,
67 size: cfg.Size,
68 reqChan: make(chan T, cfg.Size),
69 fn: fn,
70 workersCloseCh: make(chan struct{}),
71 pushesTotalMetrics: pushesTotalMetrics,
72 pushesFailuresTotalMetrics: pushesFailuresTotalMetric,
73 lengthMetric: lengthMetric,
74 readOnly: &atomic.Bool{},
75 }
76}
77
78// Push pushes data onto a queue.
79// If the queue is full, the data is dropped

Callers 4

newQueueListFunction · 0.92
newQueueFunction · 0.70

Calls

no outgoing calls

Tested by 2

newQueueFunction · 0.56