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

Method Publish

coderd/database/pubsub/pubsub_memory.go:66–84  ·  view source on GitHub ↗
(event string, message []byte)

Source from the content-addressed store, hash-verified

64}
65
66func (m *MemoryPubsub) Publish(event string, message []byte) error {
67 m.mut.RLock()
68 defer m.mut.RUnlock()
69 listeners, ok := m.listeners[event]
70 if !ok {
71 return nil
72 }
73 var wg sync.WaitGroup
74 for _, listener := range listeners {
75 wg.Add(1)
76 go func() {
77 defer wg.Done()
78 listener.send(context.Background(), message)
79 }()
80 }
81 wg.Wait()
82
83 return nil
84}
85
86func (*MemoryPubsub) Close() error {
87 return nil

Callers

nothing calls this directly

Calls 4

AddMethod · 0.65
WaitMethod · 0.65
DoneMethod · 0.45
sendMethod · 0.45

Tested by

no test coverage detected