Skip to content

Commit

Permalink
signal when we are done
Browse files Browse the repository at this point in the history
  • Loading branch information
Daisuke Maki committed Sep 29, 2024
1 parent 9de8a68 commit a47356d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions proxysink/proxysink.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@ func New[T any](b Backend[T]) *Proxy[T] {
}

func (p *Proxy[T]) Run(ctx context.Context) {
defer p.cond.Broadcast()
go p.controlloop(ctx)
go p.flushloop(ctx)

<-ctx.Done()
}

func (p *Proxy[T]) controlloop(ctx context.Context) {
defer p.cond.Broadcast()
for {
select {
case <-ctx.Done():
Expand Down

0 comments on commit a47356d

Please sign in to comment.