scotttam-resque 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. data/.gitignore +3 -0
  2. data/.kick +26 -0
  3. data/CONTRIBUTORS +23 -0
  4. data/HISTORY.md +80 -0
  5. data/LICENSE +20 -0
  6. data/README.markdown +767 -0
  7. data/Rakefile +66 -0
  8. data/bin/resque +57 -0
  9. data/bin/resque-web +18 -0
  10. data/config.ru +14 -0
  11. data/deps.rip +6 -0
  12. data/examples/async_helper.rb +31 -0
  13. data/examples/demo/README.markdown +71 -0
  14. data/examples/demo/Rakefile +3 -0
  15. data/examples/demo/app.rb +38 -0
  16. data/examples/demo/config.ru +19 -0
  17. data/examples/demo/job.rb +22 -0
  18. data/examples/god/resque.god +53 -0
  19. data/examples/god/stale.god +26 -0
  20. data/examples/instance.rb +11 -0
  21. data/examples/simple.rb +30 -0
  22. data/init.rb +1 -0
  23. data/lib/resque/errors.rb +7 -0
  24. data/lib/resque/failure/base.rb +58 -0
  25. data/lib/resque/failure/hoptoad.rb +121 -0
  26. data/lib/resque/failure/multiple.rb +44 -0
  27. data/lib/resque/failure/redis.rb +33 -0
  28. data/lib/resque/failure.rb +63 -0
  29. data/lib/resque/helpers.rb +57 -0
  30. data/lib/resque/job.rb +146 -0
  31. data/lib/resque/server/public/idle.png +0 -0
  32. data/lib/resque/server/public/jquery-1.3.2.min.js +19 -0
  33. data/lib/resque/server/public/jquery.relatize_date.js +95 -0
  34. data/lib/resque/server/public/poll.png +0 -0
  35. data/lib/resque/server/public/ranger.js +24 -0
  36. data/lib/resque/server/public/reset.css +48 -0
  37. data/lib/resque/server/public/style.css +76 -0
  38. data/lib/resque/server/public/working.png +0 -0
  39. data/lib/resque/server/views/error.erb +1 -0
  40. data/lib/resque/server/views/failed.erb +35 -0
  41. data/lib/resque/server/views/key.erb +17 -0
  42. data/lib/resque/server/views/layout.erb +38 -0
  43. data/lib/resque/server/views/next_more.erb +10 -0
  44. data/lib/resque/server/views/overview.erb +4 -0
  45. data/lib/resque/server/views/queues.erb +46 -0
  46. data/lib/resque/server/views/stats.erb +62 -0
  47. data/lib/resque/server/views/workers.erb +78 -0
  48. data/lib/resque/server/views/working.erb +69 -0
  49. data/lib/resque/server.rb +187 -0
  50. data/lib/resque/stat.rb +53 -0
  51. data/lib/resque/tasks.rb +39 -0
  52. data/lib/resque/version.rb +3 -0
  53. data/lib/resque/worker.rb +453 -0
  54. data/lib/resque.rb +246 -0
  55. data/tasks/redis.rake +135 -0
  56. data/tasks/resque.rake +2 -0
  57. data/test/redis-test.conf +132 -0
  58. data/test/resque_test.rb +220 -0
  59. data/test/test_helper.rb +96 -0
  60. data/test/worker_test.rb +260 -0
  61. metadata +172 -0
data/.gitignore ADDED
@@ -0,0 +1,3 @@
1
+ *.gemspec
2
+ pkg
3
+ nbproject
data/.kick ADDED
@@ -0,0 +1,26 @@
1
+ # take control of the growl notifications
2
+ module GrowlHacks
3
+ def growl(type, subject, body, *args, &block)
4
+ case type
5
+ when Kicker::GROWL_NOTIFICATIONS[:succeeded]
6
+ puts subject = "Success"
7
+ body = body.split("\n").last
8
+ when Kicker::GROWL_NOTIFICATIONS[:failed]
9
+ subject = "Failure"
10
+ puts body
11
+ body = body.split("\n").last
12
+ else
13
+ return nil
14
+ end
15
+ super(type, subject, body, *args, &block)
16
+ end
17
+ end
18
+
19
+ Kicker.send :extend, GrowlHacks
20
+
21
+ # no logging
22
+ Kicker::Utils.module_eval do
23
+ def log(message)
24
+ nil
25
+ end
26
+ end
data/CONTRIBUTORS ADDED
@@ -0,0 +1,23 @@
1
+ * Chris Wanstrath
2
+ * John Barnette
3
+ * Aaron Quint
4
+ * Adam Cooke
5
+ * Mike Mangino
6
+ * Rob Hanlon
7
+ * Jason Amster
8
+ * jgeiger
9
+ * Daniel Ceballos
10
+ * Matt Duncan
11
+ * Roman Heinrich
12
+ * Ben VandenBos
13
+ * Christos Trochalakis
14
+ * Matt Palmer
15
+ * Michael Dwan
16
+ * Brian P O'Rourke
17
+ * Karel Minarik
18
+ * Arthur Zapparoli
19
+ * Simon Rozet
20
+ * Dave Hoover
21
+ * PJ Hyett
22
+ * Masatomo Nakano
23
+ * gravis
data/HISTORY.md ADDED
@@ -0,0 +1,80 @@
1
+ ## 1.5.1 (2010-??-??)
2
+
3
+ * `Job.destroy` and `Resque.dequeue` return the # of destroyed jobs.
4
+ * Hoptoad notifier improvements
5
+ * Web bugfix: Tabs highlight properly now
6
+
7
+ ## 1.5.0 (2010-02-17)
8
+
9
+ * Version now included in procline, e.g. `resque-1.5.0: Message`
10
+ * Web bugfix: Ignore idle works in the "working" page
11
+ * Added `Resque::Job.destroy(queue, klass, *args)`
12
+ * Added `Resque.dequeue(klass, *args)`
13
+
14
+ ## 1.4.0 (2010-02-11)
15
+
16
+ * Fallback when unable to bind QUIT and USR1 for Windows and JRuby.
17
+ * Fallback when no `Kernel.fork` is provided (for IronRuby).
18
+ * Web: Rounded corners in Firefox
19
+ * Cut down system calls in `Worker#prune_dead_workers`
20
+ * Enable switching DB in a Redis server from config
21
+ * Support USR2 and CONT to stop and start job processing.
22
+ * Web: Add example failing job
23
+ * Bugfix: `Worker#unregister_worker` shouldn't call `done_working`
24
+ * Bugfix: Example god config now restarts Resque properly.
25
+ * Multiple failure backends now permitted.
26
+ * Hoptoad failure backend updated to new API
27
+
28
+ ## 1.3.1 (2010-01-11)
29
+
30
+ * Vegas bugfix: Don't error without a config
31
+
32
+ ## 1.3.0 (2010-01-11)
33
+
34
+ * Use Vegas for resque-web
35
+ * Web Bugfix: Show proper date/time value for failed_at on Failures
36
+ * Web Bugfix: Make the / route more flexible
37
+ * Add Resque::Server.tabs array (so plugins can add their own tabs)
38
+ * Start using [Semantic Versioning](http://semver.org/)
39
+
40
+ ## 1.2.4 (2009-12-15)
41
+
42
+ * Web Bugfix: fix key links on stat page
43
+
44
+ ## 1.2.3 (2009-12-15)
45
+
46
+ * Bugfix: Fixed `rand` seeding in child processes.
47
+ * Bugfix: Better JSON encoding/decoding without Yajl.
48
+ * Bugfix: Avoid `ps` flag error on Linux
49
+ * Add `PREFIX` observance to `rake` install tasks.
50
+
51
+ ## 1.2.2 (2009-12-08)
52
+
53
+ * Bugfix: Job equality was not properly implemented.
54
+
55
+ ## 1.2.1 (2009-12-07)
56
+
57
+ * Added `rake resque:workers` task for starting multiple workers.
58
+ * 1.9.x compatibility
59
+ * Bugfix: Yajl decoder doesn't care about valid UTF-8
60
+ * config.ru loads RESQUECONFIG if the ENV variable is set.
61
+ * `resque-web` now sets RESQUECONFIG
62
+ * Job objects know if they are equal.
63
+ * Jobs can be re-queued using `Job#recreate`
64
+
65
+ ## 1.2.0 (2009-11-25)
66
+
67
+ * If USR1 is sent and no child is found, shutdown.
68
+ * Raise when a job class does not respond to `perform`.
69
+ * Added `Resque.remove_queue` for deleting a queue
70
+
71
+ ## 1.1.0 (2009-11-04)
72
+
73
+ * Bugfix: Broken ERB tag in failure UI
74
+ * Bugfix: Save the worker's ID, not the worker itself, in the failure module
75
+ * Redesigned the sinatra web interface
76
+ * Added option to clear failed jobs
77
+
78
+ ## 1.0.0 (2009-11-03)
79
+
80
+ * First release.
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2009 Chris Wanstrath
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.