minion 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. data/README.rdoc +12 -1
  2. data/VERSION +1 -1
  3. metadata +2 -2
@@ -63,13 +63,24 @@ queues when you enqueue.
63
63
  puts "I have #{args["type"]} sandwich for #{args["me"]}"
64
64
  end
65
65
 
66
+ == Conditional Processing
67
+
68
+ If you want a minion worker to only subscribe to a queue under specific
69
+ conditions there is a :when parameter that takes a lambda as an argument. For
70
+ example, if you had a queue that makes sandwiches but only if there is bread
71
+ on hand, it would be.
72
+
73
+ job "make.sandwich", :when => lambda { not Bread.out? } do
74
+ Sandwich.make
75
+ end
76
+
66
77
  == Error handling
67
78
 
68
79
  When an error is thrown in a job handler, the job is requeued to be done later
69
80
  and the minion process exits. If you define an error handler, however, the
70
81
  error handler is run and the job is removed from the queue.
71
82
 
72
- on_error do |e|
83
+ error do |e|
73
84
  puts "got an error! #{e}"
74
85
  end
75
86
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.3
1
+ 0.1.4
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minion
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Orion Henry
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-08-31 00:00:00 -04:00
12
+ date: 2009-09-02 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency