Skip to content

Consider supporting ActiveJob::Continuation as an alternative to job-iteration #1398

@kwent

Description

@kwent

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions