MCPcopy Index your code
hub / github.com/coder/coder / notifySubscribers

Method notifySubscribers

agent/agentgit/pathstore.go:72–86  ·  view source on GitHub ↗

notifySubscribers sends a non-blocking signal to all subscriber channels for the given chat IDs.

(chatIDs []uuid.UUID)

Source from the content-addressed store, hash-verified

70// notifySubscribers sends a non-blocking signal to all subscriber
71// channels for the given chat IDs.
72func (ps *PathStore) notifySubscribers(chatIDs []uuid.UUID) {
73 ps.mu.RLock()
74 toNotify := make([]chan<- struct{}, 0)
75 for _, id := range chatIDs {
76 toNotify = append(toNotify, ps.subscribers[id]...)
77 }
78 ps.mu.RUnlock()
79
80 for _, ch := range toNotify {
81 select {
82 case ch <- struct{}{}:
83 default:
84 }
85 }
86}
87
88// GetPaths returns all paths tracked for a chat, deduplicated
89// and sorted lexicographically.

Callers 2

AddPathsMethod · 0.95
NotifyMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected