Publish publishes an event, which will notify all matching subscriptions.
(evs ...events.Event)
| 81 | |
| 82 | // Publish publishes an event, which will notify all matching subscriptions. |
| 83 | func (e *PubSub) Publish(evs ...events.Event) { |
| 84 | e.mu.RLock() |
| 85 | subscriptions := e.subscriptions |
| 86 | e.mu.RUnlock() |
| 87 | for _, evt := range evs { |
| 88 | trace.WithRegion(evt.Context(), "publish event", func() { |
| 89 | for _, sub := range subscriptions { |
| 90 | if sub.Match(evt) { |
| 91 | sub.Notify(evt) |
| 92 | } |
| 93 | } |
| 94 | }) |
| 95 | } |
| 96 | } |
nothing calls this directly
no test coverage detected