Skip to content
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

fix: make passing of LD_NONBLOCKING in C bindings consistent #107

Merged
merged 2 commits into from
May 23, 2023

Conversation

cwaldren-ld
Copy link
Contributor

@cwaldren-ld cwaldren-ld commented May 23, 2023

Before, the asynchronous methods (Flush/Identify) were taking a signed int milliseconds argument, where negative represented nonblocking, and 0/positive numbers were a delay.

This reduces the state to simply 0/positive numbers. LD_NONBLOCKING is defined as 0. There's no point having a 3rd state for nonblocking.

@cwaldren-ld cwaldren-ld force-pushed the cw/consistent-blocking branch from 0be8039 to f00dd49 Compare May 23, 2023 19:50
@@ -118,7 +120,7 @@ LDClientSDK_Identify(LDClientSDK sdk, LDContext context, int milliseconds) {

LDContext_Free(context);

if (milliseconds < 0) {
if (milliseconds == LD_NONBLOCKING) {
return;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could also just call wait_for with 0, but I believe there's no guarantee that won't block for some tiny amount of time.

@cwaldren-ld cwaldren-ld marked this pull request as ready for review May 23, 2023 19:52
@cwaldren-ld cwaldren-ld requested a review from kinyoklion May 23, 2023 19:52
@cwaldren-ld cwaldren-ld merged commit 36f56b5 into main May 23, 2023
@cwaldren-ld cwaldren-ld deleted the cw/consistent-blocking branch May 23, 2023 21:00
@github-actions github-actions bot mentioned this pull request May 23, 2023
@github-actions github-actions bot mentioned this pull request May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants