mapper: remove Batcher interface, rename to Batcher struct

Remove the Batcher interface since there is only one implementation.
Rename LockFreeBatcher to Batcher and merge batcher_lockfree.go into
batcher.go.

Drop type assertions in debug.go now that mapBatcher is a concrete
*mapper.Batcher pointer.
This commit is contained in:
Kristoffer Dalby 2026-03-13 13:42:42 +00:00
parent 9b24a39943
commit 2058343ad6
8 changed files with 1064 additions and 1169 deletions

View file

@ -148,8 +148,8 @@ func BenchmarkUpdateSentPeers(b *testing.B) {
// benchBatcher creates a lightweight batcher for benchmarks. Unlike the test
// helper, it doesn't register cleanup and suppresses logging.
func benchBatcher(nodeCount, bufferSize int) (*LockFreeBatcher, map[types.NodeID]chan *tailcfg.MapResponse) {
b := &LockFreeBatcher{
func benchBatcher(nodeCount, bufferSize int) (*Batcher, map[types.NodeID]chan *tailcfg.MapResponse) {
b := &Batcher{
tick: time.NewTicker(1 * time.Hour), // never fires during bench
workers: 4,
workCh: make(chan work, 4*200),