Sha256: 5dfef9b9fa6a6d41602a7308b5ab8c9bec9136659801f8e552bda431ffb15a75
Contents?: true
Size: 1.36 KB
Versions: 2
Compression:
Stored size: 1.36 KB
Contents
Little Stuff ----------- [ ] Show stale workers in red with a warning icon in the Sinatra app Big Stuff --------- ### async I want the `async` helper to be first class. Something like this: class Repository < ActiveRecord::Base include Resque::AsyncHelper end This adds an `async` instance method and a `perform` class method. The `async` method looks like this: def async(method, *args) Resque.enqueue(self.class, id, method, *args) end The `perform` method looks like this: def self.perform(id, method, *args) find(id).send(method, *args) end Of course, you can define your own `self.perform` and have it still work beautifully. We might override ours in GitHub to look like this: def self.perform(id, method, *args) return unless repo = cached_by_id(id) repo.send(method, *args) end Then: `@repo.async(:update_disk_usage)` issues a job equivalent to: Resque.enqueue(Repository, 44, :update_disk_usage) Booyah. ### gem install `gem install resque` should pull in yajl, redis, sinatra, rake, and rack Do it like Unicorn does it. ### Parent / Child => Master / Workers On an ideal setup (REE + Linux) you'll have 2N Resque processes running at any time: N parents and N children. We can cut this number down to N+1 by moving from a parent / child architecture to a master / workers architecture.
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
resque-1.0.0 | TODO.md |
resque-0.2.0 | TODO.md |