MCPcopy
hub / github.com/IBM/sarama / Add

Method Add

internal/queue/queue.go:36–43  ·  view source on GitHub ↗

Add appends elem, growing the buffer if it is full.

(elem T)

Source from the content-addressed store, hash-verified

34
35// Add appends elem, growing the buffer if it is full.
36func (q *Queue[T]) Add(elem T) {
37 if q.count == len(q.buf) {
38 q.resize()
39 }
40 q.buf[q.tail] = elem
41 q.tail = (q.tail + 1) & (len(q.buf) - 1)
42 q.count++
43}
44
45// Peek returns the head element. It panics if the queue is empty.
46func (q *Queue[T]) Peek() T {

Callers 15

produceMsgsFunction · 0.45
consumeMsgsFunction · 0.45
buildRequestMethod · 0.45
closeProducerWithTimeoutFunction · 0.45
computeBackoffMethod · 0.45
parseRecordsMethod · 0.45
parseResponseMethod · 0.45
subscriptionConsumerMethod · 0.45

Calls 1

resizeMethod · 0.95