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

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.

Join the discussion

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

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

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

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2020 GoRails, LLC. All rights reserved.