Skip to content

Conversation

@dranikpg
Copy link
Contributor

@dranikpg dranikpg commented Jan 27, 2026

In case something needs to return neither an error nor perform an action - like return an array of null values, etc

@dranikpg dranikpg requested a review from romange January 27, 2026 07:37
@dranikpg dranikpg marked this pull request as ready for review January 29, 2026 07:58
Copilot AI review requested due to automatic review settings January 29, 2026 07:58
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces the ability for async command contexts to return immediately without executing any transaction, addressing the need for commands that need to return neither an error nor perform an action (like returning an array of null values). The key addition is the JustReplySentinel type that allows commands to signal they want to reply directly without scheduling any operations.

Changes:

  • Added JustReplySentinel struct to allow commands to signal immediate reply without execution
  • Updated AsyncContextInterface::PrepareResult to include JustReplySentinel as a third variant option
  • Modified RunSync and RunAsync to handle the new JustReplySentinel case
  • Replaced usage of SendNotFound() helper method with direct MCRender calls for better consistency
  • Removed SendNotFound() helper from ParsedCommand class

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
src/server/cmd_support.h Added JustReplySentinel struct and JustReply() helper method; updated PrepareResult variant to include the new sentinel type
src/server/cmd_support.cc Updated RunSync and RunAsync to handle JustReplySentinel case, allowing immediate replies without blocking
src/server/string_family.cc Replaced SendNotFound() call with direct MCRender::RenderNotFound() usage
src/facade/parsed_command.h Removed SendNotFound() helper method

@augmentcode
Copy link

augmentcode bot commented Jan 29, 2026

🤖 Augment PR Summary

Summary: This PR extends the async command-support API to allow contexts to “just reply” without scheduling any transactional work.

Changes:

  • Introduced a new `JustReplySentinel` type and added it to `AsyncContextInterface::PrepareResult`
  • Updated `AsyncContextInterface::RunSync` / `RunAsync` to accept the sentinel and reply immediately when no blocker is needed
  • Added `SimpleContext::JustReply()` helper for CRTP-based async command contexts
  • Removed `ParsedCommand::SendNotFound()` and inlined the memcache “NOT_FOUND/NF” rendering at the single call site

Technical Notes: In deferred-reply mode, the “just reply” path uses ReplyWith() to store a ready-to-send reply function rather than registering an async blocker.

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 1 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Co-authored-by: Copilot <[email protected]>
Signed-off-by: Vladislav <[email protected]>
Copilot AI review requested due to automatic review settings January 29, 2026 09:37
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Co-authored-by: Copilot <[email protected]>
Signed-off-by: Roman Gershman <[email protected]>
Copilot AI review requested due to automatic review settings January 30, 2026 08:54
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

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