chore: Allow JustReply() in cmd-support#6478
Conversation
There was a problem hiding this comment.
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
JustReplySentinelstruct to allow commands to signal immediate reply without execution - Updated
AsyncContextInterface::PrepareResultto includeJustReplySentinelas a third variant option - Modified
RunSyncandRunAsyncto handle the newJustReplySentinelcase - Replaced usage of
SendNotFound()helper method with directMCRendercalls for better consistency - Removed
SendNotFound()helper fromParsedCommandclass
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 |
🤖 Augment PR SummarySummary: This PR extends the async command-support API to allow contexts to “just reply” without scheduling any transactional work. Changes:
Technical Notes: In deferred-reply mode, the “just reply” path uses 🤖 Was this summary useful? React with 👍 or 👎 |
Co-authored-by: Copilot <[email protected]> Signed-off-by: Vladislav <[email protected]>
Co-authored-by: Copilot <[email protected]> Signed-off-by: Roman Gershman <[email protected]>
In case something needs to return neither an error nor perform an action - like return an array of null values, etc