With Rails 4 we began using Active Job to run tasks in the background that take a long time.
Active Job provides the framework, and we use Resque and Redis to implement the queuing and running of background tasks.
##Running resque and redis in the development environment
-
Download and install Redis (I did this on the vagrant vm in the home directory of the vagrant user.)
wget http://download.redis.io/redis-stable.tar.gz tar xvzf redis-stable.tar.gz cd redis-stable make sudo make install
The output recommends that you run make test
, but it requires a newer version of tcl
so I didn't bother.
-
Start
redis-server
in one shell by simply running the executable. This is the memory store for keeping track of jobs in the queue. -
Resque is a gem and should have been installed when you ran
bundle install.
To start up resque use the following in another shell window.
VVERBOSE=1 QUEUE=* bundle exec rake environment resque:work
Note: This should be fixed because VERBOSE is deprecated.