Ensure schemas wait for init
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
package streams
|
||||
|
||||
import "sync"
|
||||
|
||||
var (
|
||||
ready = make(chan struct{})
|
||||
readyOnce sync.Once
|
||||
)
|
||||
|
||||
func SetReady() {
|
||||
readyOnce.Do(func() {
|
||||
close(ready)
|
||||
})
|
||||
}
|
||||
|
||||
func WaitReady() {
|
||||
<-ready
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user