You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The examples show how to wait for player being finished as
for player.IsPlaying() {
time.Sleep(time.Millisecond)
}
This smells badly. What is needed is players to signal something like a EOF, probably through a channel, so that waiting for the player to be finished could be done with something like
<-playerFinished
Alternatively, a sync.WaitGroup might be appropriate, with 1 counter. Player could have method Wait() just calling the Wait() method of the sync.WaitGroup. Then any number of goroutines / threads could wait for the player to be finished.
The text was updated successfully, but these errors were encountered:
The examples show how to wait for player being finished as
This smells badly. What is needed is players to signal something like a EOF, probably through a channel, so that waiting for the player to be finished could be done with something like
Alternatively, a sync.WaitGroup might be appropriate, with 1 counter. Player could have method
Wait()
just calling theWait()
method of the sync.WaitGroup. Then any number of goroutines / threads could wait for the player to be finished.The text was updated successfully, but these errors were encountered: