Sha256: edc853e6c74dcad9248562717d3efb5be9f737be17a320031a1a58ffcf0f52e4

Contents?: true

Size: 677 Bytes

Versions: 7

Compression:

Stored size: 677 Bytes

Contents

# frozen_string_literal: true

begin
  require 'retryable'
rescue LoadError
  STDERR.puts 'BusinessFlow::Retryable requires the retryable gem'
  raise
end

module BusinessFlow
  # Wraps a flow in a Retryable (https://github.com/nfedyashev/retryable)
  # You must provide this gem yourself
  module Retryable
    def self.included(klass)
      klass.extend(ClassMethods)
    end

    # Additions to the DSL
    module ClassMethods
      def retryable(opts)
        @retryable_config ||= {}
        @retryable_config.merge!(opts)
      end

      def execute(flow)
        ::Retryable.retryable(@retryable_config) do
          super(flow)
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
business_flow-0.19.4 lib/business_flow/retryable.rb
business_flow-0.19.3 lib/business_flow/retryable.rb
business_flow-0.19.2 lib/business_flow/retryable.rb
business_flow-0.19.1 lib/business_flow/retryable.rb
business_flow-0.19.0 lib/business_flow/retryable.rb
business_flow-0.18.1 lib/business_flow/retryable.rb
business_flow-0.18.0 lib/business_flow/retryable.rb