MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / setAuthUpdateQueue

Method setAuthUpdateQueue

internal/watcher/dispatcher.go:19–40  ·  view source on GitHub ↗
(queue chan<- AuthUpdate)

Source from the content-addressed store, hash-verified

17var snapshotCoreAuthsFunc = snapshotCoreAuths
18
19func (w *Watcher) setAuthUpdateQueue(queue chan<- AuthUpdate) {
20 w.clientsMutex.Lock()
21 defer w.clientsMutex.Unlock()
22 w.authQueue = queue
23 if w.dispatchCond == nil {
24 w.dispatchCond = sync.NewCond(&w.dispatchMu)
25 }
26 if w.dispatchCancel != nil {
27 w.dispatchCancel()
28 if w.dispatchCond != nil {
29 w.dispatchMu.Lock()
30 w.dispatchCond.Broadcast()
31 w.dispatchMu.Unlock()
32 }
33 w.dispatchCancel = nil
34 }
35 if queue != nil {
36 ctx, cancel := context.WithCancel(context.Background())
37 w.dispatchCancel = cancel
38 go w.dispatchLoop(ctx)
39 }
40}
41
42func (w *Watcher) dispatchRuntimeAuthUpdate(update AuthUpdate) bool {
43 if w == nil {

Callers 1

SetAuthUpdateQueueMethod · 0.95

Calls 1

dispatchLoopMethod · 0.95

Tested by

no test coverage detected