Ask A Question

Notifications

You’re not receiving notifications from this thread.

How to run serial (multi-step) background jobs?

Daniel Weaver asked in Rails

After a user submits a URL via a form I need to run a handful of jobs in series

What would be a good way to do this?

  1. User submits URL
  2. Use the URL to build file paths
  3. Download file 1 from file path and upload to S3
  4. Download file 2 from file path and upload to S3
  5. Call an API endpoint with the S3 URLs

Steps 3 and 4 could be done in parallel but they both need to be complete before step 5 can run so I'm just going to keep it simple and run all in series.

The naïve option seems to be simply call each step at the end of the previous one. I found this article on multi-step jobs but it seems overly complicated.

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 81,842+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more.

    © 2024 GoRails, LLC. All rights reserved.