Reputation: 15
In an interview I was asked this and I was unable to describe this. Could anyone help me with this.
Upvotes: -2
Views: 93
Reputation: 165396
It isn't a fair question.
While @dbugger is correct that, generally, a "worker" processes a "job", Rails doesn't use the term "worker" in relation to "jobs".
Where Rails does use the term "worker" they're referring to processes in a pool like the ActionCable worker pool or Puma web server processes.
Resque does use worker/job, but that's not Rails.
Sidekiq did, but not anymore because, as they put it....
The term "worker" is too generic and overly confusing, used in several different contexts meaning different things. Many people call a Sidekiq process a "worker". Some people call the thread that executes jobs a "worker". This change brings Sidekiq closer to ActiveJob where your job classes extend ApplicationJob.
Upvotes: 2