Sha256: bf5fccfdabc6698e88be7296d029d83dde13cb8e82cf711c09614bfc303eb248

Contents?: true

Size: 646 Bytes

Versions: 14

Compression:

Stored size: 646 Bytes

Contents

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

14 entries across 14 versions & 1 rubygems

Version Path
business_flow-0.17.5 lib/business_flow/retryable.rb
business_flow-0.17.4 lib/business_flow/retryable.rb
business_flow-0.17.3 lib/business_flow/retryable.rb
business_flow-0.17.2 lib/business_flow/retryable.rb
business_flow-0.17.1 lib/business_flow/retryable.rb
business_flow-0.17.0 lib/business_flow/retryable.rb
business_flow-0.16.0 lib/business_flow/retryable.rb
business_flow-0.15.1 lib/business_flow/retryable.rb
business_flow-0.15.0 lib/business_flow/retryable.rb
business_flow-0.14.3 lib/business_flow/retryable.rb
business_flow-0.14.2 lib/business_flow/retryable.rb
business_flow-0.14.1 lib/business_flow/retryable.rb
business_flow-0.14.0 lib/business_flow/retryable.rb
business_flow-0.13.0 lib/business_flow/retryable.rb