395 Background processing [2d]

Updated . Posted . Visible to the public.

Some tasks in a web application are better not done live when a user request a page, but in the background. Examples are

  • longer running tasks
  • tasks that are not tied to user interaction
  • tasks that can fail, and may need to be retried

Our two main mechanisms for background processing are

Learn about cronjobs

Note

We use the whenever Show archive.org snapshot to automatically rewrite the crontab when we deploy. You have already intergrated whenever in your MovieDB in Consuming external APIs with Ruby.

Exercise

  • In State machines you created a review process for new movies.
  • Write a cronjob that automatically rejects a movie if it hasn't been accepted for 7 days.

Learn about Sidekiq

Exercise: Move API calls to a Sidekiq job

You've previously implemented calls to external APIs in your MovieDB.

Henning Koch
Last edit
Henning Koch
License
Source code in this card is licensed under the MIT License.
Posted by Henning Koch to makandra Curriculum (2015-09-30 12:48)