GH-920: Improve pipelining documentation#3381
Open
won-seoop wants to merge 1 commit into
Open
Conversation
Addresses the documentation gaps raised in spring-projects#920: * Add a dedicated section showing the fire-and-forget pattern using the standard execute(callback, exposeConnection, pipeline) overload, which was mentioned in prose but had no code example. * Use "list" instead of "queue" throughout, consistent with Redis documentation for the underlying data type. * Replace the single rPop example with two examples: one focused bulk rPop and one showing mixed command types (SET, RPUSH, GET, LRANGE) to demonstrate that each index in the returned List corresponds to the command at that position. * Clarify that the doInRedis() return value must be null (discarded) by explaining why, not just noting the requirement. * Add a NOTE explaining that read command results are not available inside the callback — they only appear in the returned List after the pipeline is flushed — to prevent the misconception that you can branch on a read result within a single pipeline call. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
What
Closes #920.
Improves the Redis pipelining reference documentation by addressing the specific gaps raised in the issue.
Changes
Fire-and-forget mode (new section)
The existing docs mentioned
execute(callback, true)for "when you don't care about results" but provided no code example. Added an explicit section with a working example.Terminology: "list" not "queue"
Changed the comment and the Redis key name from
myqueuetomylist, consistent with Redis's own documentation for the underlying data type thatRPOP/RPUSHoperate on.Mixed-operation example (new example)
Added a second example that pipelines
SET,RPUSH,GET, andLRANGEin a single callback and maps each index of the returnedListto the command that produced it. This addresses the request to show "various (not just RPOP) operations returning different data types."doInRedis()return valueChanged the note from a bare requirement ("must be null") to an explanation: the value is discarded because Spring Data Redis uses the pipeline results instead. The example now uses a callout
<1>to tie the code to the explanation.Read results inside the callback
Added a
NOTEblock explaining that read commands are queued and their results are not available inside the callback — they appear in the returnedListafter the pipeline is flushed. This prevents the misconception (raised in the issue) that you can branch on a read result within the same pipeline call.Test plan
rPop("mylist")is consistent with Redis list semantics.🤖 Generated with Claude Code