Remove APIs for separate init and connect of async cluster contexts#165
Merged
bjosv merged 7 commits intovalkey-io:mainfrom Feb 7, 2025
Merged
Remove APIs for separate init and connect of async cluster contexts#165bjosv merged 7 commits intovalkey-io:mainfrom
bjosv merged 7 commits intovalkey-io:mainfrom
Conversation
Reallocate and embed the valkeyClusterContext in the created valkeyClusterAsyncContext
to be able to cast between these types. This enables users to access the async context
in an event callback without using privdata, and we can remove the APIs previously
kept just for this scenario:
valkeyClusterAsyncContext *valkeyClusterAsyncContextInit(const valkeyClusterOptions *options);
int valkeyClusterAsyncConnect(valkeyClusterAsyncContext *acc);
int valkeyClusterAsyncSetEventCallback(valkeyClusterAsyncContext *acc,
void(fn)(const valkeyClusterContext *cc,
int event, void *privdata),
Remove testcase using clusterclient_reconnect_async.c since it was using the removed APIs.
Signed-off-by: Björn Svensson <[email protected]>
Signed-off-by: Björn Svensson <[email protected]>
Signed-off-by: Björn Svensson <[email protected]>
zuiderkwast
reviewed
Feb 6, 2025
Signed-off-by: Björn Svensson <[email protected]>
Signed-off-by: Björn Svensson <[email protected]>
Signed-off-by: Björn Svensson <[email protected]>
Signed-off-by: Björn Svensson <[email protected]>
zuiderkwast
approved these changes
Feb 7, 2025
Collaborator
zuiderkwast
left a comment
There was a problem hiding this comment.
LGTM
+154 −393 is great diff statistics!
Collaborator
Author
Oh, lovely, some early spring cleaning. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Embed a
valkeyClusterContextin a createdvalkeyClusterAsyncContextto be able to cast between these types. This enables users to access the async context in an event callback without usingprivdata, and we can remove the APIs previously kept just for this scenario:Also removing the testcase based on
clusterclient_reconnect_async.csince it was using the removed APIs.There is now a symmetry to how standalone contexts works, i.e.
valkeyAsyncContextembeds thevalkeyContext.