Skip to content

Latest commit

 

History

History
32 lines (22 loc) · 1.28 KB

ResqueRedis.md

File metadata and controls

32 lines (22 loc) · 1.28 KB

Running Background Processes with Resque and Redis

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

  1. 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.

  1. Start redis-server in one shell by simply running the executable. This is the memory store for keeping track of jobs in the queue.

  2. 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.