MCPcopy Create free account
hub / github.com/daodst/chat / getQueue

Method getQueue

federationapi/queue/queue.go:154–179  ·  view source on GitHub ↗
(destination gomatrixserverlib.ServerName)

Source from the content-addressed store, hash-verified

152}
153
154func (oqs *OutgoingQueues) getQueue(destination gomatrixserverlib.ServerName) *destinationQueue {
155 if oqs.statistics.ForServer(destination).Blacklisted() {
156 return nil
157 }
158 oqs.queuesMutex.Lock()
159 defer oqs.queuesMutex.Unlock()
160 oq, ok := oqs.queues[destination]
161 if !ok || oq == nil {
162 destinationQueueTotal.Inc()
163 oq = &destinationQueue{
164 queues: oqs,
165 db: oqs.db,
166 process: oqs.process,
167 rsAPI: oqs.rsAPI,
168 origin: oqs.origin,
169 destination: destination,
170 client: oqs.client,
171 statistics: oqs.statistics.ForServer(destination),
172 notify: make(chan struct{}, 1),
173 interruptBackoff: make(chan bool),
174 signing: oqs.signing,
175 }
176 oqs.queues[destination] = oq
177 }
178 return oq
179}
180
181func (oqs *OutgoingQueues) clearQueue(oq *destinationQueue) {
182 oqs.queuesMutex.Lock()

Callers 4

NewOutgoingQueuesFunction · 0.95
SendEventMethod · 0.95
SendEDUMethod · 0.95
RetryServerMethod · 0.95

Calls 4

LockMethod · 0.80
UnlockMethod · 0.80
BlacklistedMethod · 0.45
ForServerMethod · 0.45

Tested by

no test coverage detected