MCPcopy Index your code
hub / github.com/apache/answer / Close

Method Close

internal/base/queue/queue.go:89–101  ·  view source on GitHub ↗

Close gracefully shuts down the queue, waiting for pending messages to be processed.

()

Source from the content-addressed store, hash-verified

87
88// Close gracefully shuts down the queue, waiting for pending messages to be processed.
89func (q *Queue[T]) Close() {
90 q.mu.Lock()
91 if q.closed {
92 q.mu.Unlock()
93 return
94 }
95 q.closed = true
96 q.mu.Unlock()
97
98 close(q.queue)
99 q.wg.Wait()
100 log.Infof("[%s] queue closed", q.name)
101}
102
103// startWorker starts the background goroutine that processes messages.
104func (q *Queue[T]) startWorker() {

Callers

nothing calls this directly

Calls 1

closeFunction · 0.85

Tested by

no test coverage detected