Sha256: 9022c43735ba4f5bcb9805b2987a04ea9f7620c46b0f3e51e572ab209a86ed0c

Contents?: true

Size: 278 Bytes

Versions: 2

Compression:

Stored size: 278 Bytes

Contents

module AttemptThis
	# Implementation of binary backoff policy. Internal use only.
	class BinaryBackoffPolicy
		# Initializer.
		def initialize(initial_delay)
			@delay = initial_delay
		end

		# Calls the policy.
		def call
			Kernel.sleep(@delay)
			@delay *= 2
		end
	end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
attempt_this-0.9.0 lib/attempt_this/binary_backoff_policy.rb
attempt_this-0.8.1 lib/attempt_this/binary_backoff_policy.rb