MCPcopy Create free account
hub / github.com/MacroPower/kat / broadcast

Method broadcast

pkg/command/static.go:100–110  ·  view source on GitHub ↗
(evt Event)

Source from the content-addressed store, hash-verified

98}
99
100func (rg *Static) broadcast(evt Event) {
101 ctx := evt.GetContext()
102
103 log.WithContext(ctx).DebugContext(ctx, "broadcasting event",
104 slog.String("event", fmt.Sprintf("%T", evt)),
105 )
106
107 for _, ch := range rg.listeners {
108 ch <- evt
109 }
110}
111
112// SendEvent allows external components to send events to all listeners.
113func (rg *Static) SendEvent(evt Event) {

Callers 3

RunContextMethod · 0.95
SendEventMethod · 0.95
RunPluginContextMethod · 0.95

Calls 3

WithContextFunction · 0.92
GetContextMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected