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

Function SetDefaultEventsPubSub

pkg/util/test/events.go:234–242  ·  view source on GitHub ↗

SetDefaultEventsPubSub calls events.SetDefaultPubSub and returns a function that can be used to undo the action. Following calls to SetDefaultEventsPubSub will block until undo function is called.

(ps events.PubSub)

Source from the content-addressed store, hash-verified

232// returns a function that can be used to undo the action.
233// Following calls to SetDefaultEventsPubSub will block until undo function is called.
234func SetDefaultEventsPubSub(ps events.PubSub) func() {
235 eventsPubSubMu.Lock()
236 oldPS := eventsPubSub
237 eventsPubSub = ps
238 return func() {
239 eventsPubSub = oldPS
240 eventsPubSubMu.Unlock()
241 }
242}
243
244// CollectEvents collects events published by f.
245func CollectEvents(f func()) []events.Event {

Callers 6

FrontendFunction · 0.92
StartTestFunction · 0.92
ExampleFunction · 0.92
CollectEventsFunction · 0.85
RedirectEventsFunction · 0.85

Calls

no outgoing calls

Tested by 3

StartTestFunction · 0.74
ExampleFunction · 0.74