Module: CI::Queue::Common
- Included in:
- Redis::Base, Static
- Defined in:
- lib/ci/queue/common.rb
Constant Summary collapse
- CONNECTION_ERRORS =
to override in classes including this module
[].freeze
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
- #flaky?(test) ⇒ Boolean
- #report_failure! ⇒ Object
- #report_success! ⇒ Object
- #rescue_connection_errors(handler = ->(err) { nil }) ⇒ Object
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
4 5 6 |
# File 'lib/ci/queue/common.rb', line 4 def config @config end |
Instance Method Details
#flaky?(test) ⇒ Boolean
9 10 11 |
# File 'lib/ci/queue/common.rb', line 9 def flaky?(test) @config.flaky?(test) end |
#report_failure! ⇒ Object
13 14 15 |
# File 'lib/ci/queue/common.rb', line 13 def report_failure! config.circuit_breaker.report_failure! end |
#report_success! ⇒ Object
17 18 19 |
# File 'lib/ci/queue/common.rb', line 17 def report_success! config.circuit_breaker.report_success! end |
#rescue_connection_errors(handler = ->(err) { nil }) ⇒ Object
21 22 23 24 25 |
# File 'lib/ci/queue/common.rb', line 21 def rescue_connection_errors(handler = ->(err) { nil }) yield rescue *self::class::CONNECTION_ERRORS => err handler.call(err) end |