Class: Chantier::FailurePolicies::None
- Inherits:
-
Object
- Object
- Chantier::FailurePolicies::None
- Defined in:
- lib/failure_policies.rb
Overview
A very basic failure policy that will do nothing at all. It will always answer “nil” to limit_reached?, therefore allowing the works to proceed indefinitely. By overriding the four main methods on it you can control the policy further.
Note that all calls to arm!, failure!, success! and limit_reached? are automatically protected by a Mutex - you don’t need to set one up yourself.
Direct Known Subclasses
Instance Method Summary collapse
-
#arm! ⇒ Object
Start counting the failures (will be triggered on the first job).
-
#failure! ⇒ Object
Increment the failure counter.
-
#limit_reached? ⇒ Boolean
Tells whether the failure policy has been triggered.
-
#success! ⇒ Object
Increment the success counter.
Instance Method Details
#arm! ⇒ Object
Start counting the failures (will be triggered on the first job). You can manually call this to reset the object the object to the initial state (reset error counts)
13 14 |
# File 'lib/failure_policies.rb', line 13 def arm! end |
#failure! ⇒ Object
Increment the failure counter
17 18 |
# File 'lib/failure_policies.rb', line 17 def failure! end |
#limit_reached? ⇒ Boolean
Tells whether the failure policy has been triggered. Return something falsey from here if everything is in order
26 27 |
# File 'lib/failure_policies.rb', line 26 def limit_reached? end |
#success! ⇒ Object
Increment the success counter
21 22 |
# File 'lib/failure_policies.rb', line 21 def success! end |