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)
| 232 | // returns a function that can be used to undo the action. |
| 233 | // Following calls to SetDefaultEventsPubSub will block until undo function is called. |
| 234 | func 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. |
| 245 | func CollectEvents(f func()) []events.Event { |
no outgoing calls