ActiveJob Callbacks

Episode #505 by Teacher's Avatar David Kimura

Summary

Callbacks are typically something that I avoid or try to use only if they make sense. However, in background jobs, they have a different feel to them and can be very powerful while helping keep the code organized. In this episode, we'll explore three different callbacks in the background jobs.
rails background processing callbacks 7:01

Chapters

  • Introduction (0:00)
  • Creating a job (0:59)
  • after_discard (1:40)
  • Making external call (2:45)
  • discard_on (4:35)
  • Other use cases (5:13)
  • retry_on (5:48)
Student & Teacher
$ 9 /mo

Valid School Email Required

Same Access as Pro

Subscribe Now
Pro Monthly
$ 19 /mo

Access to Pro Episodes

Invite to Slack Channel

Priority Suggestions

Ad Free

Subscribe Now
Pro Annual
$ 190 /yr

Access to Pro Episodes

Invite to Slack Channel

Priority Suggestions

Ad Free

Subscribe Now
Teams
$ 57 /mo

3 Users Minimum

$19.00 / user / month

Same Access as Pro

Subscribe to Teams