Class: NatsWork::Middleware::Retry
- Inherits:
-
Object
- Object
- NatsWork::Middleware::Retry
- Defined in:
- lib/natswork/middleware.rb
Instance Method Summary collapse
- #call(_job, message) ⇒ Object
-
#initialize(retry_handler:, connection: nil) ⇒ Retry
constructor
A new instance of Retry.
Constructor Details
#initialize(retry_handler:, connection: nil) ⇒ Retry
Returns a new instance of Retry.
119 120 121 122 |
# File 'lib/natswork/middleware.rb', line 119 def initialize(retry_handler:, connection: nil) @retry_handler = retry_handler @connection = connection end |
Instance Method Details
#call(_job, message) ⇒ Object
124 125 126 127 128 129 |
# File 'lib/natswork/middleware.rb', line 124 def call(_job, ) yield rescue StandardError => e handle_error(, e) nil # Don't propagate error end |