test/test_helper.rb in resque-throttle-0.1.0 vs test/test_helper.rb in resque-throttle-0.2.0
- old
+ new
@@ -21,23 +21,32 @@
end
class OneHourThrottledJob < Resque::ThrottledJob
@queue = :some_queue
- def self.throttle
- 3600
- end
-
+ throttle :can_run_every => 3600,
+ :enqueued => "Yada Yada",
+ :throttled => "Yada Yada",
+ :latest => "Yada Yada"
+
+
def self.perform(some_id, some_other_thing)
end
end
class IdetifierThrottledJob < Resque::ThrottledJob
@queue = :some_queue
- def self.identifier
- "my_identifier"
+ throttle :identifier => "my_identifier"
+
+ def self.perform(some_id, some_other_thing)
end
-
+end
+
+class DisabledThrottledJob < Resque::ThrottledJob
+ @queue = :some_queue
+
+ throttle :disabled => true
+
def self.perform(some_id, some_other_thing)
end
end