Skip to content

Instantly share code, notes, and snippets.

@juanpaco
Last active August 29, 2015 14:05
Show Gist options
  • Save juanpaco/ea37069f16fcef1e4744 to your computer and use it in GitHub Desktop.
Save juanpaco/ea37069f16fcef1e4744 to your computer and use it in GitHub Desktop.
Background jobs as anti-pattern

When you say background job, are you referring to a Rails-specific implementation or the entire idea of delaying processing for a later time?

I'm quite happy to shed bad ideas I've accumulated. One good candidate for background processing I've always kept in my mind is sending an email on a user registration. I wouldn't want the email send process to tie up the request/response cycle, nor would I want a failure in that sending to cause a problem to the request/response cycle.

Is it an anti-pattern to delay that sending? I don't see how the concept is coupled to ActiveRecord, which is why I don't think I understand what you mean by "background job." But, my acquired wisdom could also be very wrong, and I want to shed that sort of thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment