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

chore: Remove template Callbacks #4431

Merged

Conversation

BagritsevichStepan
Copy link
Contributor

No description provided.

@BagritsevichStepan BagritsevichStepan self-assigned this Jan 8, 2025
@romange
Copy link
Collaborator

romange commented Jan 8, 2025

@BagritsevichStepan please see #4368
I do not understand why callback is needed at all

@BagritsevichStepan
Copy link
Contributor Author

@BagritsevichStepan please see #4368 I do not understand why callback is needed at all

It was used just to reduce boilerplate code. And we are now performing the same check twice:

if (!parsed_json) {
    VLOG(1) << "got invalid JSON string '" << json_str << "' cannot be saved";
    return OpStatus::INVALID_VALUE;
  }

@romange
Copy link
Collaborator

romange commented Jan 8, 2025

I think this is not justified to change interfaces of function to save a few lines. Moreover, it actually had a bug of copying a json object instead of moving it. With memory allocators is becomes a correctness bug where we probably loose the correct resource. All this is not worth it.

Signed-off-by: Stepan Bagritsevich <[email protected]>
Copy link
Contributor

@kostasrim kostasrim left a comment

Choose a reason for hiding this comment

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

Ask Roman if he wants to eliminate the callbacks alltogether before you merge this

@BagritsevichStepan
Copy link
Contributor Author

@romange

@romange romange merged commit f6441df into dragonflydb:main Jan 13, 2025
9 checks passed
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.

3 participants