docs: document inspecting and editing batch slices from the console#52
Merged
Conversation
Expand the Batch Guide beyond the single each_failed_record example with two new sections: - Inspecting slices from the console: counting, fetching, and iterating slices via the state scopes (queued/running/failed/completed), reading records and per-slice metadata, inspecting the embedded exception, and the previously-undocumented group_exceptions summary helper. - Editing and retrying failed records: correcting a bad record in place and retrying, with the running-job (slice.retry!) vs failed-job (job.retry!) distinction called out. Co-Authored-By: Claude Opus 4.8 <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.
Summary
Expands the Batch Guide's console/debugging coverage. Previously the only documented way to inspect a batch job's slices was a single
each_failed_recordexample. This adds two sections, all verified againstlib/rocket_job/sliced/andlib/rocket_job/batch/:job.input.count, per-state.failed.count, etc.), fetching/iterating via the state scopes (queued/running/failed/completed) plusfirst/last/each/where, readingrecordsand per-slice metadata (first_record_number,failure_count,failed_record, ...), inspecting the embeddedJobException, and the previously-undocumentedgroup_exceptionsaggregation helper. Notes that it all applies tojob.outputand named categories.recordsis a plain Array;save!persists it) and retrying, including the resume-from-processing_record_numberbehavior and the key distinction:slice.retry!works while the job is stillrunning, but afailedjob needsjob.retry!since workers only process slices for a running job.Notes
docs/batch.md), no code changes.~~~rubytilde fences and bold-prose "Example:" labels so they stay out of the auto-generated TOC (the two new##headings do appear in the TOC).🤖 Generated with Claude Code