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.59 lib/knj/tests/test_retry.rb
knjrbfw-0.0.58 lib/knj/tests/test_retry.rb
knjrbfw-0.0.57 lib/knj/tests/test_retry.rb
knjrbfw-0.0.55 lib/knj/tests/test_retry.rb
knjrbfw-0.0.54 lib/knj/tests/test_retry.rb
knjrbfw-0.0.53 lib/knj/tests/test_retry.rb
knjrbfw-0.0.52 lib/knj/tests/test_retry.rb
knjrbfw-0.0.51 lib/knj/tests/test_retry.rb
knjrbfw-0.0.50 lib/knj/tests/test_retry.rb
knjrbfw-0.0.49 lib/knj/tests/test_retry.rb
knjrbfw-0.0.48 lib/knj/tests/test_retry.rb
knjrbfw-0.0.47 lib/knj/tests/test_retry.rb
knjrbfw-0.0.46 lib/knj/tests/test_retry.rb
knjrbfw-0.0.45 lib/knj/tests/test_retry.rb
knjrbfw-0.0.44 lib/knj/tests/test_retry.rb
knjrbfw-0.0.43 lib/knj/tests/test_retry.rb
knjrbfw-0.0.42 lib/knj/tests/test_retry.rb
knjrbfw-0.0.41 lib/knj/tests/test_retry.rb
knjrbfw-0.0.40 lib/knj/tests/test_retry.rb
knjrbfw-0.0.39 lib/knj/tests/test_retry.rb