Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a worker in ruby/rails?

I am coming from the Java world and keep hearing this term 'worker' in the ruby/rails world. What is it? a thread?

like image 819
Kamilski81 Avatar asked Apr 26 '12 17:04

Kamilski81


People also ask

What is a worker in Ruby?

Workers is a Ruby gem for performing work in background threads. Design goals include high performance, low latency, simple API, customizability, and multi-layered architecture.

What is a worker in Sidekiq?

Workarea applications use Sidekiq as a job queuing backend to perform units of work asynchronously in the background. These jobs, which include search indexing, cache busting, and cleanup of expired data, are defined as workers .

What is a background worker Rails?

Rails background workers: Sidekiq overview and how to deploy it to Heroku. Sidekiq is a framework for background job processing that is very useful for handling expensive computation, emails, and other processes that is better served outside of the main web application.


1 Answers

Depends on the context.

A worker is typically a process that runs outside of your application request cycle. Ruby libraries like resque and delayed_job are typically used to manage worker queues.

On the other hand, if we're talking about web servers the word "worker" is sometimes used interchangeably with threads or processes (ie: nginx or apache "workers").

like image 181
Damien Wilson Avatar answered Sep 20 '22 02:09

Damien Wilson