Summary
When users perform operations inside an apipeline context manager (deletes, updates, field assignments, TTL refreshes, etc.), the return values from those operations are currently not accessible. The pipeline's execute() is called internally on context exit and its results are discarded. Users need a way to access these results so they can know, for example, how many keys were deleted, what previous values were overwritten, or whether specific operations succeeded.
Features / Details
- Provide a mechanism for users to retrieve the results of all actions performed during an
apipeline block
- Each operation queued in the pipeline (delete, update, field set, TTL refresh, etc.) should have its return value accessible after the pipeline executes
- Results should be associated/identifiable with the originating action (not just an opaque flat list of Redis responses) so users can correlate which result belongs to which operation
- Must work for both
apipeline() (standalone) and the use_existing_pipe=True case
- Must continue to work correctly with the
ignore_redis_error and NOSCRIPT recovery paths (rapyer/base.py:1018)
Use Cases
- A user calls
adelete on multiple models inside apipeline and wants to know which actually existed and were deleted
- A user updates fields inside
apipeline and wants the previous values returned by the underlying Redis commands
- A user refreshes TTLs inside
apipeline and wants to confirm which keys had their TTL successfully updated
- Bulk operations where the caller needs per-operation success/failure feedback without giving up the atomicity of a pipeline
Implementation Considerations
- The pipeline currently executes inside
_apipeline after the yield (rapyer/base.py:1037-1045), so results are only available post-yield — the API needs to surface them to user code that ran before the yield returned
- Likely options: return a results object/handle that the user obtains inside the
with block and reads after exit, or expose results via the context (e.g., attach to the yielded pipe or to the rapyer context)
- Need to handle the NOSCRIPT retry path (
rapyer/base.py:1058-1072) — results from the retry pipeline must replace/merge with the original results coherently
- Need to decide behavior when
ignore_redis_error=True swallows a ResponseError — results may be partial or absent
- Operations performed via Lua scripts (EVALSHA) return script results; mapping these back to the high-level rapyer action that issued them needs design
- Consider how this interacts with
use_existing_pipe=True where the user may own the outer pipeline lifecycle
List tasks
Summary
When users perform operations inside an
apipelinecontext manager (deletes, updates, field assignments, TTL refreshes, etc.), the return values from those operations are currently not accessible. The pipeline'sexecute()is called internally on context exit and its results are discarded. Users need a way to access these results so they can know, for example, how many keys were deleted, what previous values were overwritten, or whether specific operations succeeded.Features / Details
apipelineblockapipeline()(standalone) and theuse_existing_pipe=Truecaseignore_redis_errorand NOSCRIPT recovery paths (rapyer/base.py:1018)Use Cases
adeleteon multiple models insideapipelineand wants to know which actually existed and were deletedapipelineand wants the previous values returned by the underlying Redis commandsapipelineand wants to confirm which keys had their TTL successfully updatedImplementation Considerations
_apipelineafter theyield(rapyer/base.py:1037-1045), so results are only available post-yield — the API needs to surface them to user code that ran before the yield returnedwithblock and reads after exit, or expose results via the context (e.g., attach to the yieldedpipeor to the rapyer context)rapyer/base.py:1058-1072) — results from the retry pipeline must replace/merge with the original results coherentlyignore_redis_error=Trueswallows aResponseError— results may be partial or absentuse_existing_pipe=Truewhere the user may own the outer pipeline lifecycleList tasks
pipe.execute()and map responses to the registered actionsignore_redis_error=True— document and implement behavior for partial/absent resultsuse_existing_pipe=True— define how results are surfaced when rapyer doesn't own pipeline executiontests/unit/pipeline/covering result retrieval for each supported action typetests/integration/pipeline/covering end-to-end result retrievaldocs/api/rapyer-functions.md,docs/documentation/atomic-actions.md, anddocs/api/atomic-redis-model.md