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

Method Peek

internal/queue/queue.go:46–51  ·  view source on GitHub ↗

Peek returns the head element. It panics if the queue is empty.

()

Source from the content-addressed store, hash-verified

44
45// Peek returns the head element. It panics if the queue is empty.
46func (q *Queue[T]) Peek() T {
47 if q.count <= 0 {
48 panic("queue: Peek() called on empty queue")
49 }
50 return q.buf[q.head]
51}
52
53// Remove pops and returns the head element. It panics if the queue is empty.
54func (q *Queue[T]) Remove() T {

Callers 3

newBrokerProducerMethod · 0.80
retryHandlerMethod · 0.80
TestQueueFunction · 0.80

Calls

no outgoing calls

Tested by 1

TestQueueFunction · 0.64