Closed nlsun closed 7 years ago
@mesosphere-ci Retest this please.
@mesosphere-ci Retest this please.
@mesosphere-ci Retest this please.
@mesosphere-ci Retest this please.
Consider using a channel instead of a bool for ready
in the resolver. Then where you set ready=true
, res.readyCh <- true
instead. And change Ready()
to WaitUntilReady()
func WaitUntilReady() {
<-res.readyCh
}
This way you don't need the sleep.
If you had several people calling Ready()
(or WaitUntilReady()
) you would have to use close(res.readyCh)
instead of just sending a bool to it. In that case, just be careful because you will need to replace res.readyCh
with a fresh channel at the top of Reload()
so you don't get a close of closed channel
error. And then you'll need the lock to prevent racing on res.readyCh
:p
@gpaul Agreed, I've switched to using a channel.
@mesosphere-ci Retest this please.
@mesosphere-ci Retest this please.
Nice one :ship:
@mesosphere-ci Retest this please.
@mesosphere-ci retest me please