Summary
Rails 8.1 introduces ActiveJob::Continuation (ActiveJob::Continuable), which provides built-in support for interruptible, resumable jobs with cursor-based progress tracking — functionality that closely overlaps with what job-iteration provides today.
Since maintenance_tasks depends on job-iteration for its core iteration/resumption engine, it would be worth considering whether ActiveJob::Continuation could serve as an alternative backend for Rails 8.1+ apps, potentially making the job-iteration dependency optional.
Key overlaps
| Feature |
job-iteration |
ActiveJob::Continuation |
| Interruptible iteration |
Yes |
Yes (via step + checkpoint!) |
| Cursor-based resumption |
Yes |
Yes (set!, advance!, from:) |
| ActiveRecord collection iteration |
Yes (build_enumerator) |
Yes (find_each(start: step.cursor)) |
| Nested collection support |
Yes |
Yes (array cursors) |
| Auto-retry after progress |
Yes |
Yes |
Potential approach
- For Rails < 8.1: continue using
job-iteration as today
- For Rails >= 8.1: allow tasks to use
ActiveJob::Continuable instead, making job-iteration an optional dependency
Questions
- Is this something the team has already been thinking about given that this is a Shopify gem and
job-iteration is also a Shopify gem?
- Would it make sense to support both backends, or would a full migration to
ActiveJob::Continuation (with a minimum Rails version bump) be preferred long-term?
Summary
Rails 8.1 introduces
ActiveJob::Continuation(ActiveJob::Continuable), which provides built-in support for interruptible, resumable jobs with cursor-based progress tracking — functionality that closely overlaps with whatjob-iterationprovides today.Since
maintenance_tasksdepends onjob-iterationfor its core iteration/resumption engine, it would be worth considering whetherActiveJob::Continuationcould serve as an alternative backend for Rails 8.1+ apps, potentially making thejob-iterationdependency optional.Key overlaps
job-iterationActiveJob::Continuationstep+checkpoint!)set!,advance!,from:)build_enumerator)find_each(start: step.cursor))Potential approach
job-iterationas todayActiveJob::Continuableinstead, makingjob-iterationan optional dependencyQuestions
job-iterationis also a Shopify gem?ActiveJob::Continuation(with a minimum Rails version bump) be preferred long-term?