-
Notifications
You must be signed in to change notification settings - Fork 6
FF-3380 feat: add EppoClient.Initialized() method to wait for initialization #72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file was extracted from configurationstore.go
without any changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this!
}, result) | ||
} | ||
|
||
func Test_Initialized_timeout(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙌
|
||
go func() { | ||
<-time.After(1 * time.Microsecond) | ||
configurationStore.setConfiguration(configuration{}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
timedOut = true | ||
} | ||
|
||
assert.False(t, timedOut) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
case <-client.Initialized(): | ||
timedOut = false | ||
case <-time.After(1 * time.Millisecond): | ||
timedOut = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to ChatGPT, this select block will wait for one of these two channels to complete, similar to JavaScript's Promise.race() 👌
No description provided.