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 <charon@lethean.io>
This commit is contained in:
parent
a29ded5159
commit
4628b2b094
1 changed files with 5 additions and 0 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue