Skip to content

Commit

Permalink
wait for update callbacks to finish
Browse files Browse the repository at this point in the history
  • Loading branch information
sukunrt committed Mar 13, 2024
1 parent 94e5867 commit 287233b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion agent_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,12 @@ func (a *Agent) candidatePairRoutine() {

func (a *Agent) connectionStateRoutine() {
for s := range a.chanState {
go a.onConnectionStateChange(s)
ch := make(chan struct{})
go func() {
a.onConnectionStateChange(s)
close(ch)
}()
<-ch
}
}

Expand Down

0 comments on commit 287233b

Please sign in to comment.