{"id":15048185,"url":"https://github.com/github/resque","last_synced_at":"2025-10-04T08:32:02.245Z","repository":{"id":4974814,"uuid":"6132642","full_name":"github/resque","owner":"github","description":"Used by Enterprise! Resque is a Redis-backed Ruby library for controlling background jobs.","archived":true,"fork":true,"pushed_at":"2020-11-16T21:16:36.000Z","size":2403,"stargazers_count":223,"open_issues_count":2,"forks_count":30,"subscribers_count":30,"default_branch":"github","last_synced_at":"2024-09-30T00:23:39.439Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://enterprise.github.com","language":"Ruby","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"skalnik/resque","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/github.png","metadata":{"files":{"readme":"README.markdown","changelog":"HISTORY.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-10-08T23:10:18.000Z","updated_at":"2024-08-28T14:40:41.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/github/resque","commit_stats":null,"previous_names":[],"tags_count":73,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Fresque","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Fresque/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Fresque/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Fresque/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/github","download_url":"https://codeload.github.com/github/resque/tar.gz/refs/heads/github","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235232838,"owners_count":18957058,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-24T21:08:59.862Z","updated_at":"2025-10-04T08:31:56.834Z","avatar_url":"https://github.com/github.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"Resque\n======\n\nResque (pronounced like \"rescue\") is a Redis-backed library for creating\nbackground jobs, placing those jobs on multiple queues, and processing\nthem later.\n\nBackground jobs can be any Ruby class or module that responds to\n`perform`. Your existing classes can easily be converted to background\njobs or you can create new classes specifically to do work. Or, you\ncan do both.\n\nResque is heavily inspired by DelayedJob (which rocks) and comprises\nthree parts:\n\n1. A Ruby library for creating, querying, and processing jobs\n2. A Rake task for starting a worker which processes jobs\n3. A Sinatra app for monitoring queues, jobs, and workers.\n\nResque workers can be distributed between multiple machines,\nsupport priorities, are resilient to memory bloat / \"leaks,\" are\noptimized for REE (but work on MRI and JRuby), tell you what they're\ndoing, and expect failure.\n\nResque queues are persistent; support constant time, atomic push and\npop (thanks to Redis); provide visibility into their contents; and\nstore jobs as simple JSON packages.\n\nThe Resque frontend tells you what workers are doing, what workers are\nnot doing, what queues you're using, what's in those queues, provides\ngeneral usage stats, and helps you track failures.\n\n\nThe Blog Post\n-------------\n\nFor the backstory, philosophy, and history of Resque's beginnings,\nplease see [the blog post][0].\n\n\nOverview\n--------\n\nResque allows you to create jobs and place them on a queue, then,\nlater, pull those jobs off the queue and process them.\n\nResque jobs are Ruby classes (or modules) which respond to the\n`perform` method. Here's an example:\n\n\n``` ruby\nclass Archive\n  @queue = :file_serve\n\n  def self.perform(repo_id, branch = 'master')\n    repo = Repository.find(repo_id)\n    repo.create_archive(branch)\n  end\nend\n```\n\nThe `@queue` class instance variable determines which queue `Archive`\njobs will be placed in. Queues are arbitrary and created on the fly -\nyou can name them whatever you want and have as many as you want.\n\nTo place an `Archive` job on the `file_serve` queue, we might add this\nto our application's pre-existing `Repository` class:\n\n``` ruby\nclass Repository\n  def async_create_archive(branch)\n    Resque.enqueue(Archive, self.id, branch)\n  end\nend\n```\n\nNow when we call `repo.async_create_archive('masterbrew')` in our\napplication, a job will be created and placed on the `file_serve`\nqueue.\n\nLater, a worker will run something like this code to process the job:\n\n``` ruby\nklass, args = Resque.reserve(:file_serve)\nklass.perform(*args) if klass.respond_to? :perform\n```\n\nWhich translates to:\n\n``` ruby\nArchive.perform(44, 'masterbrew')\n```\n\nLet's start a worker to run `file_serve` jobs:\n\n    $ cd app_root\n    $ QUEUE=file_serve rake resque:work\n\nThis starts one Resque worker and tells it to work off the\n`file_serve` queue. As soon as it's ready it'll try to run the\n`Resque.reserve` code snippet above and process jobs until it can't\nfind any more, at which point it will sleep for a small period and\nrepeatedly poll the queue for more jobs.\n\nWorkers can be given multiple queues (a \"queue list\") and run on\nmultiple machines. In fact they can be run anywhere with network\naccess to the Redis server.\n\n\nJobs\n----\n\nWhat should you run in the background? Anything that takes any time at\nall. Slow INSERT statements, disk manipulating, data processing, etc.\n\nAt GitHub we use Resque to process the following types of jobs:\n\n* Warming caches\n* Counting disk usage\n* Building tarballs\n* Building Rubygems\n* Firing off web hooks\n* Creating events in the db and pre-caching them\n* Building graphs\n* Deleting users\n* Updating our search index\n\nAs of writing we have about 35 different types of background jobs.\n\nKeep in mind that you don't need a web app to use Resque - we just\nmention \"foreground\" and \"background\" because they make conceptual\nsense. You could easily be spidering sites and sticking data which\nneeds to be crunched later into a queue.\n\n\n### Persistence\n\nJobs are persisted to queues as JSON objects. Let's take our `Archive`\nexample from above. We'll run the following code to create a job:\n\n``` ruby\nrepo = Repository.find(44)\nrepo.async_create_archive('masterbrew')\n```\n\nThe following JSON will be stored in the `file_serve` queue:\n\n``` javascript\n{\n    'class': 'Archive',\n    'args': [ 44, 'masterbrew' ]\n}\n```\n\nBecause of this your jobs must only accept arguments that can be JSON encoded.\n\nSo instead of doing this:\n\n``` ruby\nResque.enqueue(Archive, self, branch)\n```\n\ndo this:\n\n``` ruby\nResque.enqueue(Archive, self.id, branch)\n```\n\nThis is why our above example (and all the examples in `examples/`)\nuses object IDs instead of passing around the objects.\n\nWhile this is less convenient than just sticking a marshaled object\nin the database, it gives you a slight advantage: your jobs will be\nrun against the most recent version of an object because they need to\npull from the DB or cache.\n\nIf your jobs were run against marshaled objects, they could\npotentially be operating on a stale record with out-of-date information.\n\n\n### send_later / async\n\nWant something like DelayedJob's `send_later` or the ability to use\ninstance methods instead of just methods for jobs? See the `examples/`\ndirectory for goodies.\n\nWe plan to provide first class `async` support in a future release.\n\n\n### Failure\n\nIf a job raises an exception, it is logged and handed off to the\n`Resque::Failure` module. Failures are logged either locally in Redis\nor using some different backend.\n\nFor example, Resque ships with Hoptoad support.\n\nKeep this in mind when writing your jobs: you may want to throw\nexceptions you would not normally throw in order to assist debugging.\n\n\nWorkers\n-------\n\nResque workers are rake tasks that run forever. They basically do this:\n\n``` ruby\nstart\nloop do\n  if job = reserve\n    job.process\n  else\n    sleep 5 # Polling frequency = 5 \n  end\nend\nshutdown\n```\n\nStarting a worker is simple. Here's our example from earlier:\n\n    $ QUEUE=file_serve rake resque:work\n\nBy default Resque won't know about your application's\nenvironment. That is, it won't be able to find and run your jobs - it\nneeds to load your application into memory.\n\nIf we've installed Resque as a Rails plugin, we might run this command\nfrom our RAILS_ROOT:\n\n    $ QUEUE=file_serve rake environment resque:work\n\nThis will load the environment before starting a worker. Alternately\nwe can define a `resque:setup` task with a dependency on the\n`environment` rake task:\n\n``` ruby\ntask \"resque:setup\" =\u003e :environment\n```\n\nGitHub's setup task looks like this:\n\n``` ruby\ntask \"resque:setup\" =\u003e :environment do\n  Grit::Git.git_timeout = 10.minutes\nend\n```\n\nWe don't want the `git_timeout` as high as 10 minutes in our web app,\nbut in the Resque workers it's fine.\n\n\n### Logging\n\nWorkers support basic logging to STDOUT. If you start them with the\n`VERBOSE` env variable set, they will print basic debugging\ninformation. You can also set the `VVERBOSE` (very verbose) env\nvariable.\n\n    $ VVERBOSE=1 QUEUE=file_serve rake environment resque:work\n\n### Process IDs (PIDs)\n\nThere are scenarios where it's helpful to record the PID of a resque\nworker process.  Use the PIDFILE option for easy access to the PID:\n\n    $ PIDFILE=./resque.pid QUEUE=file_serve rake environment resque:work\n\n### Running in the background\n\n(Only supported with ruby \u003e= 1.9). There are scenarios where it's helpful for\nthe resque worker to run itself in the background (usually in combination with\nPIDFILE).  Use the BACKGROUND option so that rake will return as soon as the\nworker is started.\n\n    $ PIDFILE=./resque.pid BACKGROUND=yes QUEUE=file_serve \\\n        rake environment resque:work\n\n### Polling frequency\n\nYou can pass an INTERVAL option which is a float representing the polling frequency. \nThe default is 5 seconds, but for a semi-active app you may want to use a smaller value.\n\n    $ INTERVAL=0.1 QUEUE=file_serve rake environment resque:work\n\n### Priorities and Queue Lists\n\nResque doesn't support numeric priorities but instead uses the order\nof queues you give it. We call this list of queues the \"queue list.\"\n\nLet's say we add a `warm_cache` queue in addition to our `file_serve`\nqueue. We'd now start a worker like so:\n\n    $ QUEUES=file_serve,warm_cache rake resque:work\n\nWhen the worker looks for new jobs, it will first check\n`file_serve`. If it finds a job, it'll process it then check\n`file_serve` again. It will keep checking `file_serve` until no more\njobs are available. At that point, it will check `warm_cache`. If it\nfinds a job it'll process it then check `file_serve` (repeating the\nwhole process).\n\nIn this way you can prioritize certain queues. At GitHub we start our\nworkers with something like this:\n\n    $ QUEUES=critical,archive,high,low rake resque:work\n\nNotice the `archive` queue - it is specialized and in our future\narchitecture will only be run from a single machine.\n\nAt that point we'll start workers on our generalized background\nmachines with this command:\n\n    $ QUEUES=critical,high,low rake resque:work\n\nAnd workers on our specialized archive machine with this command:\n\n    $ QUEUE=archive rake resque:work\n\n\n### Running All Queues\n\nIf you want your workers to work off of every queue, including new\nqueues created on the fly, you can use a splat:\n\n    $ QUEUE=* rake resque:work\n\nQueues will be processed in alphabetical order.\n\n\n### Running Multiple Workers\n\nAt GitHub we use god to start and stop multiple workers. A sample god\nconfiguration file is included under `examples/god`. We recommend this\nmethod.\n\nIf you'd like to run multiple workers in development mode, you can do\nso using the `resque:workers` rake task:\n\n    $ COUNT=5 QUEUE=* rake resque:workers\n\nThis will spawn five Resque workers, each in its own thread. Hitting\nctrl-c should be sufficient to stop them all.\n\n\n### Forking\n\nOn certain platforms, when a Resque worker reserves a job it\nimmediately forks a child process. The child processes the job then\nexits. When the child has exited successfully, the worker reserves\nanother job and repeats the process.\n\nWhy?\n\nBecause Resque assumes chaos.\n\nResque assumes your background workers will lock up, run too long, or\nhave unwanted memory growth.\n\nIf Resque workers processed jobs themselves, it'd be hard to whip them\ninto shape. Let's say one is using too much memory: you send it a\nsignal that says \"shutdown after you finish processing the current\njob,\" and it does so. It then starts up again - loading your entire\napplication environment. This adds useless CPU cycles and causes a\ndelay in queue processing.\n\nPlus, what if it's using too much memory and has stopped responding to\nsignals?\n\nThanks to Resque's parent / child architecture, jobs that use too much memory\nrelease that memory upon completion. No unwanted growth.\n\nAnd what if a job is running too long? You'd need to `kill -9` it then\nstart the worker again. With Resque's parent / child architecture you\ncan tell the parent to forcefully kill the child then immediately\nstart processing more jobs. No startup delay or wasted cycles.\n\nThe parent / child architecture helps us keep tabs on what workers are\ndoing, too. By eliminating the need to `kill -9` workers we can have\nparents remove themselves from the global listing of workers. If we\njust ruthlessly killed workers, we'd need a separate watchdog process\nto add and remove them to the global listing - which becomes\ncomplicated.\n\nWorkers instead handle their own state.\n\n\n### Parents and Children\n\nHere's a parent / child pair doing some work:\n\n    $ ps -e -o pid,command | grep [r]esque\n    92099 resque: Forked 92102 at 1253142769\n    92102 resque: Processing file_serve since 1253142769\n\nYou can clearly see that process 92099 forked 92102, which has been\nworking since 1253142769.\n\n(By advertising the time they began processing you can easily use monit\nor god to kill stale workers.)\n\nWhen a parent process is idle, it lets you know what queues it is\nwaiting for work on:\n\n    $ ps -e -o pid,command | grep [r]esque\n    92099 resque: Waiting for file_serve,warm_cache\n\n\n### Signals\n\nResque workers respond to a few different signals:\n\n* `QUIT` - Wait for child to finish processing then exit\n* `TERM` / `INT` - Immediately kill child then exit\n* `USR1` - Immediately kill child but don't exit\n* `USR2` - Don't start to process any new jobs\n* `CONT` - Start to process new jobs again after a USR2\n\nIf you want to gracefully shutdown a Resque worker, use `QUIT`.\n\nIf you want to kill a stale or stuck child, use `USR1`. Processing\nwill continue as normal unless the child was not found. In that case\nResque assumes the parent process is in a bad state and shuts down.\n\nIf you want to kill a stale or stuck child and shutdown, use `TERM`\n\nIf you want to stop processing jobs, but want to leave the worker running\n(for example, to temporarily alleviate load), use `USR2` to stop processing,\nthen `CONT` to start it again.\n\n### Mysql::Error: MySQL server has gone away\n\nIf your workers remain idle for too long they may lose their MySQL\nconnection. If that happens we recommend using [this\nGist](http://gist.github.com/238999).\n\n\nThe Front End\n-------------\n\nResque comes with a Sinatra-based front end for seeing what's up with\nyour queue.\n\n![The Front End](https://img.skitch.com/20110528-pc67a8qsfapgjxf5gagxd92fcu.png)\n\n### Standalone\n\nIf you've installed Resque as a gem running the front end standalone is easy:\n\n    $ resque-web\n\nIt's a thin layer around `rackup` so it's configurable as well:\n\n    $ resque-web -p 8282\n\nIf you have a Resque config file you want evaluated just pass it to\nthe script as the final argument:\n\n    $ resque-web -p 8282 rails_root/config/initializers/resque.rb\n\nYou can also set the namespace directly using `resque-web`:\n\n    $ resque-web -p 8282 -N myapp\n\nor set the Redis connection string if you need to do something like select a different database:\n\n    $ resque-web -p 8282 -r localhost:6379:2\n\n### Passenger\n\nUsing Passenger? Resque ships with a `config.ru` you can use. See\nPhusion's guide:\n\nApache: \u003chttp://www.modrails.com/documentation/Users%20guide%20Apache.html#_deploying_a_rack_based_ruby_application\u003e\nNginx: \u003chttp://www.modrails.com/documentation/Users%20guide%20Nginx.html#deploying_a_rack_app\u003e\n\n### Rack::URLMap\n\nIf you want to load Resque on a subpath, possibly alongside other\napps, it's easy to do with Rack's `URLMap`:\n\n``` ruby\nrequire 'resque/server'\n\nrun Rack::URLMap.new \\\n  \"/\"       =\u003e Your::App.new,\n  \"/resque\" =\u003e Resque::Server.new\n```\n\nCheck `examples/demo/config.ru` for a functional example (including\nHTTP basic auth).\n\n### Rails 3\n\nYou can also mount Resque on a subpath in your existing Rails 3 app by adding `require 'resque/server'` to the top of your routes file or in an initializer then adding this to `routes.rb`:\n\n``` ruby\nmount Resque::Server.new, :at =\u003e \"/resque\"\n```\n\n\nResque vs DelayedJob\n--------------------\n\nHow does Resque compare to DelayedJob, and why would you choose one\nover the other?\n\n* Resque supports multiple queues\n* DelayedJob supports finer grained priorities\n* Resque workers are resilient to memory leaks / bloat\n* DelayedJob workers are extremely simple and easy to modify\n* Resque requires Redis\n* DelayedJob requires ActiveRecord\n* Resque can only place JSONable Ruby objects on a queue as arguments\n* DelayedJob can place _any_ Ruby object on its queue as arguments\n* Resque includes a Sinatra app for monitoring what's going on\n* DelayedJob can be queried from within your Rails app if you want to\n  add an interface\n\nIf you're doing Rails development, you already have a database and\nActiveRecord. DelayedJob is super easy to setup and works great.\nGitHub used it for many months to process almost 200 million jobs.\n\nChoose Resque if:\n\n* You need multiple queues\n* You don't care / dislike numeric priorities\n* You don't need to persist every Ruby object ever\n* You have potentially huge queues\n* You want to see what's going on\n* You expect a lot of failure / chaos\n* You can setup Redis\n* You're not running short on RAM\n\nChoose DelayedJob if:\n\n* You like numeric priorities\n* You're not doing a gigantic amount of jobs each day\n* Your queue stays small and nimble\n* There is not a lot failure / chaos\n* You want to easily throw anything on the queue\n* You don't want to setup Redis\n\nIn no way is Resque a \"better\" DelayedJob, so make sure you pick the\ntool that's best for your app.\n\n\nInstalling Redis\n----------------\n\nResque requires Redis 0.900 or higher.\n\nResque uses Redis' lists for its queues. It also stores worker state\ndata in Redis.\n\n#### Homebrew\n\nIf you're on OS X, Homebrew is the simplest way to install Redis:\n\n    $ brew install redis\n    $ redis-server /usr/local/etc/redis.conf\n\nYou now have a Redis daemon running on 6379.\n\n#### Via Resque\n\nResque includes Rake tasks (thanks to Ezra's redis-rb) that will\ninstall and run Redis for you:\n\n    $ git clone git://github.com/defunkt/resque.git\n    $ cd resque\n    $ rake redis:install dtach:install\n    $ rake redis:start\n\nOr, if you don't have admin access on your machine:\n\n    $ git clone git://github.com/defunkt/resque.git\n    $ cd resque\n    $ PREFIX=\u003cyour_prefix\u003e rake redis:install dtach:install\n    $ rake redis:start\n\nYou now have Redis running on 6379. Wait a second then hit ctrl-\\ to\ndetach and keep it running in the background.\n\nThe demo is probably the best way to figure out how to put the parts\ntogether. But, it's not that hard.\n\n\nResque Dependencies\n-------------------\n\n    $ gem install bundler\n    $ bundle install\n\n\nInstalling Resque\n-----------------\n\n### In a Rack app, as a gem\n\nFirst install the gem.\n\n    $ gem install resque\n\nNext include it in your application.\n\n``` ruby\nrequire 'resque'\n```\n\nNow start your application:\n\n    rackup config.ru\n\nThat's it! You can now create Resque jobs from within your app.\n\nTo start a worker, create a Rakefile in your app's root (or add this\nto an existing Rakefile):\n\n``` ruby\nrequire 'your/app'\nrequire 'resque/tasks'\n```\n\nNow:\n\n    $ QUEUE=* rake resque:work\n\nAlternately you can define a `resque:setup` hook in your Rakefile if you\ndon't want to load your app every time rake runs.\n\n\n### In a Rails 2.x app, as a gem\n\nFirst install the gem.\n\n    $ gem install resque\n\nNext include it in your application.\n\n    $ cat config/initializers/load_resque.rb\n    require 'resque'\n\nNow start your application:\n\n    $ ./script/server\n\nThat's it! You can now create Resque jobs from within your app.\n\nTo start a worker, add this to your Rakefile in `RAILS_ROOT`:\n\n``` ruby\nrequire 'resque/tasks'\n```\n\nNow:\n\n    $ QUEUE=* rake environment resque:work\n\nDon't forget you can define a `resque:setup` hook in\n`lib/tasks/whatever.rake` that loads the `environment` task every time.\n\n\n### In a Rails 2.x app, as a plugin\n\n    $ ./script/plugin install git://github.com/defunkt/resque\n\nThat's it! Resque will automatically be available when your Rails app\nloads.\n\nTo start a worker:\n\n    $ QUEUE=* rake environment resque:work\n\nDon't forget you can define a `resque:setup` hook in\n`lib/tasks/whatever.rake` that loads the `environment` task every time.\n\n\n### In a Rails 3 app, as a gem\n\nFirst include it in your Gemfile.\n\n    $ cat Gemfile\n    ...\n    gem 'resque'\n    ...\n\nNext install it with Bundler.\n\n    $ bundle install\n\nNow start your application:\n\n    $ rails server\n\nThat's it! You can now create Resque jobs from within your app.\n\nTo start a worker, add this to a file in `lib/tasks` (ex:\n`lib/tasks/resque.rake`):\n\n``` ruby\nrequire 'resque/tasks'\n```\n\nNow:\n\n    $ QUEUE=* rake environment resque:work\n\nDon't forget you can define a `resque:setup` hook in\n`lib/tasks/whatever.rake` that loads the `environment` task every time.\n\n\nConfiguration\n-------------\n\nYou may want to change the Redis host and port Resque connects to, or\nset various other options at startup.\n\nResque has a `redis` setter which can be given a string or a Redis\nobject. This means if you're already using Redis in your app, Resque\ncan re-use the existing connection.\n\nString: `Resque.redis = 'localhost:6379'`\n\nRedis: `Resque.redis = $redis`\n\nFor our rails app we have a `config/initializers/resque.rb` file where\nwe load `config/resque.yml` by hand and set the Redis information\nappropriately.\n\nHere's our `config/resque.yml`:\n\n    development: localhost:6379\n    test: localhost:6379\n    staging: redis1.se.github.com:6379\n    fi: localhost:6379\n    production: redis1.ae.github.com:6379\n\nAnd our initializer:\n\n``` ruby\nrails_root = ENV['RAILS_ROOT'] || File.dirname(__FILE__) + '/../..'\nrails_env = ENV['RAILS_ENV'] || 'development'\n\nresque_config = YAML.load_file(rails_root + '/config/resque.yml')\nResque.redis = resque_config[rails_env]\n```\n\nEasy peasy! Why not just use `RAILS_ROOT` and `RAILS_ENV`? Because\nthis way we can tell our Sinatra app about the config file:\n\n    $ RAILS_ENV=production resque-web rails_root/config/initializers/resque.rb\n\nNow everyone is on the same page.\n\nAlso, you could disable jobs queueing by setting 'inline' attribute.\nFor example, if you want to run all jobs in the same process for cucumber, try:\n\n``` ruby\nResque.inline = ENV['RAILS_ENV'] == \"cucumber\"\n```\n\n\nPlugins and Hooks\n-----------------\n\nFor a list of available plugins see\n\u003chttp://wiki.github.com/defunkt/resque/plugins\u003e.\n\nIf you'd like to write your own plugin, or want to customize Resque\nusing hooks (such as `Resque.after_fork`), see\n[docs/HOOKS.md](http://github.com/defunkt/resque/blob/master/docs/HOOKS.md).\n\n\nNamespaces\n----------\n\nIf you're running multiple, separate instances of Resque you may want\nto namespace the keyspaces so they do not overlap. This is not unlike\nthe approach taken by many memcached clients.\n\nThis feature is provided by the [redis-namespace][rs] library, which\nResque uses by default to separate the keys it manages from other keys\nin your Redis server.\n\nSimply use the `Resque.redis.namespace` accessor:\n\n``` ruby\nResque.redis.namespace = \"resque:GitHub\"\n```\n\nWe recommend sticking this in your initializer somewhere after Redis\nis configured.\n\n\nDemo\n----\n\nResque ships with a demo Sinatra app for creating jobs that are later\nprocessed in the background.\n\nTry it out by looking at the README, found at `examples/demo/README.markdown`.\n\n\nMonitoring\n----------\n\n### god\n\nIf you're using god to monitor Resque, we have provided example\nconfigs in `examples/god/`. One is for starting / stopping workers,\nthe other is for killing workers that have been running too long.\n\n### monit\n\nIf you're using monit, `examples/monit/resque.monit` is provided free\nof charge. This is **not** used by GitHub in production, so please\nsend patches for any tweaks or improvements you can make to it.\n\n\nQuestions\n---------\n\nPlease add them to the [FAQ](https://github.com/defunkt/resque/wiki/FAQ) or\nask on the Mailing List. The Mailing List is explained further below\n\n\nDevelopment\n-----------\n\nWant to hack on Resque?\n\nFirst clone the repo and run the tests:\n\n    git clone git://github.com/defunkt/resque.git\n    cd resque\n    rake test\n\nIf the tests do not pass make sure you have Redis installed\ncorrectly (though we make an effort to tell you if we feel this is the\ncase). The tests attempt to start an isolated instance of Redis to\nrun against.\n\nAlso make sure you've installed all the dependencies correctly. For\nexample, try loading the `redis-namespace` gem after you've installed\nit:\n\n    $ irb\n    \u003e\u003e require 'rubygems'\n    =\u003e true\n    \u003e\u003e require 'redis/namespace'\n    =\u003e true\n\nIf you get an error requiring any of the dependencies, you may have\nfailed to install them or be seeing load path issues.\n\nFeel free to ping the mailing list with your problem and we'll try to\nsort it out.\n\n\nContributing\n------------\n\nRead the [Contributing][cb] wiki page first. \n\nOnce you've made your great commits:\n\n1. [Fork][1] Resque\n2. Create a topic branch - `git checkout -b my_branch`\n3. Push to your branch - `git push origin my_branch`\n4. Create a [Pull Request](http://help.github.com/pull-requests/) from your branch\n5. That's it!\n\n\nMailing List\n------------\n\nTo join the list simply send an email to \u003cresque@librelist.com\u003e. This\nwill subscribe you and send you information about your subscription,\nincluding unsubscribe information.\n\nThe archive can be found at \u003chttp://librelist.com/browser/resque/\u003e.\n\n\nMeta\n----\n\n* Code: `git clone git://github.com/defunkt/resque.git`\n* Home: \u003chttp://github.com/defunkt/resque\u003e\n* Docs: \u003chttp://defunkt.github.com/resque/\u003e\n* Bugs: \u003chttp://github.com/defunkt/resque/issues\u003e\n* List: \u003cresque@librelist.com\u003e\n* Chat: \u003circ://irc.freenode.net/resque\u003e\n* Gems: \u003chttp://gemcutter.org/gems/resque\u003e\n\nThis project uses [Semantic Versioning][sv].\n\n\nAuthor\n------\n\nChris Wanstrath :: chris@ozmm.org :: @defunkt\n\n[0]: http://github.com/blog/542-introducing-resque\n[1]: http://help.github.com/forking/\n[2]: http://github.com/defunkt/resque/issues\n[sv]: http://semver.org/\n[rs]: http://github.com/defunkt/redis-namespace\n[cb]: http://wiki.github.com/defunkt/resque/contributing\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgithub%2Fresque","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgithub%2Fresque","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgithub%2Fresque/lists"}