Questions tagged [resque]

Resque (pronounced like "rescue") is a Redis-backed library for creating background jobs, placing those jobs on multiple queues, and processing them later.

Background jobs can be any Ruby class or module that responds to perform. Your existing classes can easily be converted to background jobs or you can create new classes specifically to do work. Or, you can do both.

Resque is heavily inspired by DelayedJob (which rocks) and comprises three parts:

A Ruby library for creating, querying, and processing jobs A Rake task for starting a worker which processes jobs A Sinatra app for monitoring queues, jobs, and workers. Resque workers can be distributed between multiple machines, support priorities, are resilient to memory bloat / "leaks," are optimized for REE (but work on MRI and JRuby), tell you what they're doing, and expect failure.

Resque queues are persistent; support constant time, atomic push and pop (thanks to Redis); provide visibility into their contents; and store jobs as simple JSON packages.

The Resque frontend tells you what workers are doing, what workers are not doing, what queues you're using, what's in those queues, provides general usage stats, and helps you track failures.

For the backstory, philosophy, and history of Resque's beginnings, please see the blog post.

1074 questions
13
votes
2 answers

How to stop God from leaving stale Resque worker processes?

I'm trying to understand how to monitor the resque worker for travis-ci with god in such a way that stopping the resque watch via god won't leave a stale worker process. In the following I'm talking about the worker process, not forked job child…
svenfuchs
  • 683
  • 6
  • 11
13
votes
4 answers

Run rails code after an update to the database has commited, without after_commit

I'm trying to battle some race cases with my background task manager. Essentially, I have a Thing object (already exists) and assign it some properties, and then save it. After it is saved with the new properties, I queue it in Resque, passing in…
Brian
  • 7,204
  • 12
  • 51
  • 84
12
votes
2 answers

Sending Devise emails through Resque

I'm trying to send Devise emails through Resque. Regular emails are getting sent through Resque just fine. And Devise emails are sent just fine, but not Devise emails through Resque. I get "Could not find a valid mapping" which implies that my…
99miles
  • 10,942
  • 18
  • 78
  • 123
12
votes
2 answers

How to get resque-web to work on Heroku?

On my dev machine, I am able to type resque-web in a console and it launches a new tab on my browser which shows the Resque interface. On Heroku, Cedar stack, how can I do the same thing? i.e. I would like to see Resque's interface for my Heroku…
Christian Fazzini
  • 19,613
  • 21
  • 110
  • 215
12
votes
1 answer

Resque or Gearman - choosing the right tool for background jobs

We are developing a web application wherein with about 50% of write requests, we end up pushing data to multiple data stores and inserting and updating significant number of records in those data stores. To improve the response time, we want to…
Nishith
  • 268
  • 3
  • 9
12
votes
2 answers

How can I run Rails background jobs on AWS Elastic Beanstalk?

I just started to use AWS Elastic Beanstalk with my rails app and I need to use the Resque gem for background jobs. However, despite all effort to search how to run Resque worker on Elastic Beanstalk, I haven't been able to figure out how? How can I…
11
votes
3 answers

What's the difference between running rake task in background vs. using gem like Delayed Job, Resque, or Sidekiq?

I need to implement some background processing to 1) send emails, 2) do some API calls. And, whatever system I use, I'll also be combining with some kind of cron scheduler (Whenever likely). I'm curious, I recognize that there's an array of really…
james
  • 3,989
  • 8
  • 47
  • 102
11
votes
2 answers

How to debug resque job in rails application

How can I debug a resque job in rails application? I just want to write some info in a log file from self.perform function. I have written this system("echo sos >> /home/maruf/Desktop/log.txt") in self.perform(). But nothing happened. What is the…
Quazi Marufur Rahman
  • 2,603
  • 5
  • 33
  • 51
11
votes
3 answers

Ruby - Exception occured: [Mysql2::Error] closed MySQL connection

I have a Rails application now only runs internally, so there's not so much visits right now. And there're two resque worker running hardly to fetch data from the web and inserts into a mysql database, every insert will followed by sleep 10 second.…
larryzhao
  • 3,173
  • 2
  • 40
  • 62
10
votes
4 answers

Resque worker failing with PostgreSQL server

I've managed to set up my workers and they used to execute without issue (in development) but now they don't in either production or development (I'm guessing after changing from SQlite3 to PostgreSQL). When I run a rake command to run the workers…
Simpleton
  • 6,285
  • 11
  • 53
  • 87
10
votes
4 answers

Have Rails 2.3.x ignore the i18n gem

I have a Rails 2.3.5 project that uses the localization features of Rails. I also happen to have Rails 3 beta installed (which depends on the i18n gem). Rails 2.3.5 will happily handle localization on it's own (without i18n installed), however if…
Jared
  • 2,408
  • 2
  • 19
  • 33
10
votes
1 answer

Rails - ActionDispatch::Http::UploadedFile in background job

I'm using a similar idea as in the importing csv and excel Railscast but as the standard code in that episode takes some time to process (uses ActiveRecord to create a new record for each row in the file) I'm getting timeouts on Heroku and would…
Marklar
  • 1,247
  • 4
  • 25
  • 48
10
votes
1 answer

GitHub's Redis and Resque failure behavior?

Anyone have any insight into how GitHub deals with the potential failure or temporary unavailability of a Redis server when using Resque? There are others that seem to have put together semi-complicated solutions as a holdover for redis-cluster…
Michael Wasser
  • 1,776
  • 2
  • 21
  • 32
9
votes
3 answers

Resque: one worker per queue

I currently have a Rails 3.0 project, with Ruby 1.9.2 and Resque. My application has multiple worker classes and multiple queues, that are dynamically created (during runtime). Also, there are multiple workers started that are free to work on any…
Henrique Zambon
  • 1,301
  • 1
  • 11
  • 20
9
votes
3 answers

scheduling dynamic jobs in resque scheduler

I'm trying to test out scheduling jobs in future using rails 3 and resque scheduler: Following is the code I'm using but I'm getting NoMethodError set_schedule. Resque.set_schedule("1", { :cron => "30 6 * * 1", :class => "Notify", :queue =>…
ed1t
  • 8,719
  • 17
  • 67
  • 110
1 2
3
71 72