mirror of https://github.com/dapr/kit.git
events/broadcaster Buffer val when writing to subscriber channel
Signed-off-by: joshvanl <me@joshvanl.dev>
This commit is contained in:
parent
65ba3783f2
commit
9b686e7493
|
@ -91,7 +91,14 @@ func (b *Broadcaster[T]) subscribe(ctx context.Context, ch chan<- T) {
|
|||
return
|
||||
case <-b.closeCh:
|
||||
return
|
||||
case ch <- <-bufferedCh:
|
||||
case val := <-bufferedCh:
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return
|
||||
case <-b.closeCh:
|
||||
return
|
||||
case ch <- val:
|
||||
}
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
|
Loading…
Reference in New Issue