Sha256: f5d7272b149d91ab06d6783edb345556285eca05973f3766ac96e52ca8340f5c
Contents?: true
Size: 800 Bytes
Versions: 12
Compression:
Stored size: 800 Bytes
Contents
module EventSourcery module EventProcessing module ErrorHandlers # Strategies for error handling. class ConstantRetry include EventSourcery::EventProcessing::ErrorHandlers::ErrorHandler # The retry interval used with {with_error_handling}. # # @api private DEFAULT_RETRY_INTERVAL = 1 def initialize(processor_name:) @processor_name = processor_name @retry_interval = DEFAULT_RETRY_INTERVAL end # Will yield the block and attempt to retry after a defined retry interval {DEFAULT_RETRY_INTERVAL}. def with_error_handling yield rescue => error report_error(error) sleep(@retry_interval) retry end end end end end
Version data entries
12 entries across 12 versions & 1 rubygems