Sha256: 32b80188b6a9897bd04ab10a0cd5e4b51c098dc68c77ec96ebe16b97f60439b1

Contents?: true

Size: 533 Bytes

Versions: 50

Compression:

Stored size: 533 Bytes

Contents

#!/usr/bin/env ruby

Dir.chdir(File.dirname(__FILE__))
require "../autoload"

count = 0
result = Knj::Retry.try(
  :exit => false,
  :interrupt => true,
  :errors => [Knj::Errors::NotFound, RuntimeError],
  :timeout => 1,
  :tries => 3,
  :return_error => true
) do
  count += 1
  print "Count: #{count.to_s}\n"
  
  if count <= 2
    exit
  end
  
  if count <= 3
    
    #raise "Test"
  end
end

#print "Error 1 was a #{result[0][:error].class.to_s} with the message: #{result[0][:error].message.to_s}\n"

Knj::Php.print_r(result)

Version data entries

50 entries across 50 versions & 1 rubygems

Version Path
knjrbfw-0.0.38 lib/knj/tests/test_retry.rb
knjrbfw-0.0.37 lib/knj/tests/test_retry.rb
knjrbfw-0.0.36 lib/knj/tests/test_retry.rb
knjrbfw-0.0.35 lib/knj/tests/test_retry.rb
knjrbfw-0.0.34 lib/knj/tests/test_retry.rb
knjrbfw-0.0.33 lib/knj/tests/test_retry.rb
knjrbfw-0.0.32 lib/knj/tests/test_retry.rb
knjrbfw-0.0.31 lib/knj/tests/test_retry.rb
knjrbfw-0.0.30 lib/knj/tests/test_retry.rb
knjrbfw-0.0.29 lib/knj/tests/test_retry.rb
knjrbfw-0.0.28 lib/knj/tests/test_retry.rb
knjrbfw-0.0.27 lib/knj/tests/test_retry.rb
knjrbfw-0.0.26 lib/knj/tests/test_retry.rb
knjrbfw-0.0.25 lib/knj/tests/test_retry.rb
knjrbfw-0.0.24 lib/knj/tests/test_retry.rb
knjrbfw-0.0.23 lib/knj/tests/test_retry.rb
knjrbfw-0.0.22 lib/knj/tests/test_retry.rb
knjrbfw-0.0.21 lib/knj/tests/test_retry.rb
knjrbfw-0.0.20 lib/knj/tests/test_retry.rb
knjrbfw-0.0.19 lib/knj/tests/test_retry.rb