MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / Publish

Method Publish

pkg/events/basic/pubsub.go:83–96  ·  view source on GitHub ↗

Publish publishes an event, which will notify all matching subscriptions.

(evs ...events.Event)

Source from the content-addressed store, hash-verified

81
82// Publish publishes an event, which will notify all matching subscriptions.
83func (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}

Callers

nothing calls this directly

Implementers 15

mockPubSubStorepkg/console/internal/events/subscripti
routerForwarderServerpkg/packetbrokeragent/mock/pbdataplane
routerHomeNetworkServerpkg/packetbrokeragent/mock/pbdataplane
noopPubSubpkg/events/default.go
PubSubpkg/events/cloud/cloud.go
multiplexerpkg/events/mux/mux.go
ephemeralPubSubpkg/events/mux/mux_test.go
PubSubpkg/events/basic/pubsub.go
PubSubpkg/events/redis/redis.go
ApplicationServerpkg/applicationserver/applicationserve
pubSubDistributorpkg/applicationserver/distribution/pub
subscriptionSetpkg/applicationserver/distribution/sub

Calls 3

ContextMethod · 0.65
MatchMethod · 0.65
NotifyMethod · 0.65

Tested by

no test coverage detected