util/eventbus: add debug hooks to snoop on bus traffic

Updates #15160

Signed-off-by: David Anderson <dave@tailscale.com>
This commit is contained in:
David Anderson
2025-03-05 19:37:03 -08:00
committed by Dave Anderson
parent dd7166cb8e
commit e80d2b4ad1
4 changed files with 56 additions and 28 deletions

View File

@@ -17,8 +17,9 @@ import (
// Subscribers that share the same client receive events one at a
// time, in the order they were published.
type Client struct {
name string
bus *Bus
name string
bus *Bus
publishDebug hook[publishedEvent]
mu sync.Mutex
pub set.Set[publisher]