mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-22 11:01:54 +00:00
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:

committed by
Dave Anderson

parent
dd7166cb8e
commit
e80d2b4ad1
@@ -5,15 +5,8 @@ package eventbus
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"time"
|
||||
)
|
||||
|
||||
type publishedEvent struct {
|
||||
Event any
|
||||
From *Client
|
||||
Published time.Time
|
||||
}
|
||||
|
||||
// publisher is a uniformly typed wrapper around Publisher[T], so that
|
||||
// debugging facilities can look at active publishers.
|
||||
type publisher interface {
|
||||
@@ -60,9 +53,8 @@ func (p *Publisher[T]) Publish(v T) {
|
||||
}
|
||||
|
||||
evt := publishedEvent{
|
||||
Event: v,
|
||||
From: p.client,
|
||||
Published: time.Now(),
|
||||
Event: v,
|
||||
From: p.client,
|
||||
}
|
||||
|
||||
select {
|
||||
|
Reference in New Issue
Block a user