Skip to content

WIP Workflows - #1

Closed
jpcamara wants to merge 13 commits into
batch-pocfrom
batch-poc--workflows
Closed

WIP Workflows#1
jpcamara wants to merge 13 commits into
batch-pocfrom
batch-poc--workflows

Conversation

@jpcamara

@jpcamara jpcamara commented Aug 2, 2024

Copy link
Copy Markdown
Owner

No description provided.

* Introduces a "batch" concept, similar to batches present in Sidekiq Pro and GoodJob

* Batches monitor a set of jobs, and when those jobs are completed can fire off a final job

* This introduces a SolidQueue::JobBatch model, as well as the ability to enqueue jobs and associate them with the batch

* There are still more ideas to figure out, but this provides a basic batch scaffolding to spark discussion
* This means we can store the arguments and settings by letting the user do `BatchJob.new(arguments).set(options)`

* Yield the batch in `enqueue` in case someone needs info from it

* When you serialize then deserialize an activejob instance, the arguments are in the serialized_arguments field and can only be transferred over by the private method `deserialize_arguments_if_needed`. This is pretty janky, so there is probably something i'm missing

* `perform_all_later` let's us do a perform_later even with instance, which does not seem to be possible on the instances themselves
* Add spec for adding arguments and options to the batch callback
* Spacing, double quotes

* Support Ruby < 3.2 by removing the implicit key/variable syntax
* on_failure fires the first time any of the jobs fail, even once

* on_success only fires if all jobs work (after retries)

* remove unused job_id
* Allows enqueueing a job within a job, as part of the batch
* Parent batches will not complete until all child batches have been completed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant