MCPcopy Create free account
hub / github.com/coder/coder / enqueue

Method enqueue

enterprise/tailnet/pgcoord.go:1519–1529  ·  view source on GitHub ↗

enqueue adds the key to the workQ if it is not already pending.

(keys ...K)

Source from the content-addressed store, hash-verified

1517
1518// enqueue adds the key to the workQ if it is not already pending.
1519func (q *workQ[K]) enqueue(keys ...K) {
1520 q.cond.L.Lock()
1521 defer q.cond.L.Unlock()
1522 for _, key := range keys {
1523 if slices.Contains(q.pending, key) {
1524 continue
1525 }
1526 q.pending = append(q.pending, key)
1527 }
1528 q.cond.Signal()
1529}
1530
1531// acquireBatch blocks until at least one pending key is available, then
1532// returns up to limit keys, moving them to inProgress. Caller must call

Callers 10

handleMethod · 0.80
handleBindingsMethod · 0.80
newConnMethod · 0.80
peerUpdateMethod · 0.80
listenPeerMethod · 0.80
listenTunnelMethod · 0.80
resyncPeerMappingsMethod · 0.80

Calls 4

SignalMethod · 0.65
LockMethod · 0.45
UnlockMethod · 0.45
ContainsMethod · 0.45