From 4628b2b094271080396ea83ad903e549af9ab8e5 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 20 Feb 2026 12:46:48 +0000 Subject: [PATCH] feat(events): add Close() method to ChannelEmitter Allows consumers to signal the drain goroutine to stop by closing the underlying channel. Used by CLI dispatch watch cleanup. Co-Authored-By: Charon --- events.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/events.go b/events.go index 1b1d00a..701a7bc 100644 --- a/events.go +++ b/events.go @@ -78,6 +78,11 @@ func (e *ChannelEmitter) Events() <-chan Event { return e.ch } +// Close closes the underlying channel, signalling consumers to stop reading. +func (e *ChannelEmitter) Close() { + close(e.ch) +} + // MultiEmitter fans out events to multiple emitters. Emission continues even // if one emitter fails — errors are collected but not returned. type MultiEmitter struct {