Recent Releases of https://github.com/kamui/retriable
https://github.com/kamui/retriable - Retriable 4.1.1
Bug fixes
retry_if,on_retry, andon_give_upare now validated to be callable (respond to#call) or falsy. A non-callable truthy value raisesArgumentErrorat configuration time instead of a laterNoMethodErroron a retry path. (#140)
Internal
- Add RBS type signatures for the public API (
Retriable.configure,config,retriable,with_override,with_context, andRetriable::Config) and validate them in CI withrbs validate. (#142) - Enforce a minimum test coverage floor and add a
bundler-auditdependency audit job to CI. (#143) - Remove an unused
CC_TEST_REPORTER_IDfrom the CI workflow. (#141)
- Ruby
Published by kamui 17 days ago
https://github.com/kamui/retriable - Retriable 4.1.0
Bug fixes
- A per-call or
with_contexttries:now clears an inheritedintervals:from global config or a context, matching the documented precedence. PreviouslyRetriable.retriable(tries: 1)was silently ignored whenintervalswas configured, runningintervals.size + 1times. Passing bothintervals:andtries:in the same call still letsintervals:win.
- Ruby
Published by kamui 17 days ago
https://github.com/kamui/retriable - Retriable 4.0.0
Major release with breaking changes. Please read carefully before upgrading.
Breaking changes
- Removed
timeout:fromRetriable.retriable,Retriable.configure, andRetriable.with_override. Prefer library-native timeout settings, or wrap the retried block inTimeout.timeout(...)directly if you still need that behavior. - Minimum Ruby version is now 3.2. Ruby 2.x, 3.0, and 3.1 users should stay on the 3.8.x line (
~> 3.8).
Features
- Added
on_give_up, a callback that runs when Retriable stops retrying after a rescued retriable exception. - Added support for passing a
SetofExceptionclasses as theon:option.
Internal
- Switched
Retriable.retriable,Retriable.with_context, and theKernelextension methods to Ruby 3.1+ anonymous block forwarding.
See the README migration section for replacement patterns and examples.
- Ruby
Published by kamui 20 days ago
https://github.com/kamui/retriable - v3.8.0
3.8.0
Deprecations
- Deprecated the
timeout:option ahead of its removal in Retriable 4.0. Non-nil timeout values supplied throughRetriable.configure,Retriable.retriable(...), orRetriable.with_override(...)now emit a deprecation warning while keeping the existing runtime behavior unchanged. On Ruby 2.7+ the warning is emitted viaKernel.warn(..., category: :deprecated), so callers can silence it through the standard Ruby controls (Warning[:deprecated] = false,ruby -W:no-deprecated, or a customWarning.warn). To keep the notice from drowning busy applications, it is emitted at most once per process; suppression viaWarning[:deprecated]leaves the warner armed for the next call that re-enables the category. Prefer library-native timeout settings, or wrap the retried block inTimeout.timeout(...)directly if you still need that behavior. See the README migration guidance for details.
- Ruby
Published by kamui 20 days ago
https://github.com/kamui/retriable - v3.7.0
3.7.0
- Feature: Opt-in unbounded retries via
tries: Float::INFINITY. Requires a finitemax_elapsed_timeas a safety bound and is incompatible with customintervals:. Both invalid configurations raiseArgumentErrorfromConfig#validate!.
- Ruby
Published by kamui 20 days ago
https://github.com/kamui/retriable - v3.6.1
3.6.1
- Fix: Validate the
on:option before retrying. Previously, passing a non-Exceptionvalue such asObject,Kernel, or a plainModule(which appear in everyException's ancestor chain) would silently retry process-critical exceptions likeSystemExitandInterrupt. Theon:option now requires anExceptionsubclass, an array of them, or a hash whose keys are such classes and whose values arenil, aRegexp, or an array ofRegexps. Invalid shapes raiseArgumentErrorbefore the block runs. - Fix: Validate
with_override(contexts:)shape before applying overrides.contextsmay benilor a hash, and each per-context override must be a hash. - Docs: Document that
on_retry: falsedisables a callback set inRetriable.configurefor a single call.
- Ruby
Published by kamui 20 days ago
https://github.com/kamui/retriable - v3.6.0
3.6.0
- Breaking:
Retriable.overrideandRetriable.reset_overrideare removed and replaced by block-scopedRetriable.with_override(opts) { ... }. The new API requires a block, restores the previous override (or absence of override) when the block exits viaensure, and is thread-local — overrides set in one thread do not affect other threads, and child threads do not inherit them. Fibers within a thread still share the thread's active override. Nestedwith_overridecalls correctly restore the outer override on inner exit. See the README anddocs/testing.mdfor migration and testing patterns. This replaces the override API introduced in 3.5.0.
- Ruby
Published by kamui 21 days ago
https://github.com/kamui/retriable - v3.5.1
- Fix: Validate retry timing and count options before use to reject invalid retry configurations.
triesmust now be a positive integer unless a customintervalsarray is provided.
- Ruby
Published by kamui 21 days ago
https://github.com/kamui/retriable - v3.5.0
- Fix: Do not count skipped sleep intervals against
max_elapsed_timewhensleep_disabledis true. - Add
overrideandreset_overrideAPIs to force retry settings over local call options when needed (for example, test short-circuiting).
- Ruby
Published by kamui 21 days ago
https://github.com/kamui/retriable - v3.4.1
- Fix: Use
Process.clock_gettime(CLOCK_MONOTONIC)for elapsed time tracking so retry timing is immune to wall-clock adjustments (NTP, manual changes). - Fix: Handle
max_elapsed_time: nilgracefully instead of raisingNoMethodError. - Remove dead
* 1.0float coercion inExponentialBackoff#randomize.
- Ruby
Published by kamui 21 days ago
https://github.com/kamui/retriable - v3.4.0
- Add
retry_ifoption to support custom retry predicates, including checks against wrappedexception.causevalues.
- Ruby
Published by kamui 21 days ago
https://github.com/kamui/retriable - v3.3.0
- Refactor
Retriable.retriableinternals into focused private helpers to improve readability while preserving behavior. - Modernize
.rubocop.ymlwith explicit modern defaults to enable new cops while preserving existing project style policies.
- Ruby
Published by kamui 21 days ago
https://github.com/kamui/retriable - v3.2.1
- Remove executables from gemspec as it was polluting the path for some users. Thanks @hsbt.
- Ruby
Published by kamui 21 days ago
https://github.com/kamui/retriable - v3.2.0
- Require ruby 2.3+.
- Fix: Ensure
triesvalue is overridden byintervalsparameter if both are provided and add a test for this. This is always what the README stated but the code didn't actually do it. - Fix: Some rubocop offenses.
- Ruby
Published by kamui 21 days ago
https://github.com/kamui/retriable - v3.1.2
- Replace
minitestgem withrspec - Fancier README
- Remove unnecessary short circuit in
randomizemethod
- Ruby
Published by kamui 21 days ago
https://github.com/kamui/retriable - v3.1.1
- Fix typo in contexts exception message.
- Fix updating the version in the library.
- Ruby
Published by kamui 21 days ago
https://github.com/kamui/retriable - v3.1.0
- Added contexts feature. Thanks to @apurvis.
- Ruby
Published by kamui 21 days ago
https://github.com/kamui/retriable - v3.0.2
- Add configuration and options validation.
- Ruby
Published by kamui 21 days ago
https://github.com/kamui/retriable - v3.0.1
- Add
rubocoplinter to enforce coding styles for this library. Also, fix rule violations. - Removed
attr_reader :configthat caused a warning. @bruno- - Clean up Rakefile testing cruft. @bruno-
- Use
.any?in the:onhash processing. @apurvis
- Ruby
Published by kamui 21 days ago
https://github.com/kamui/retriable - v3.0.0
- Require ruby 2.0+.
- Breaking Change:
onwith aHashvalue now matches subclassed exceptions. Thanks @apurvis! - Remove
awesome_printfrom development environment.
- Ruby
Published by kamui 21 days ago
https://github.com/kamui/retriable - v2.1.0
- Fix bug #17 due to confusing the initial try as a retry.
- Switch to
Minitest5.6 expect syntax.
- Ruby
Published by kamui 21 days ago
https://github.com/kamui/retriable - v2.0.2
- Change required_ruby_version in gemspec to >= 1.9.3.
- Ruby
Published by kamui 21 days ago
https://github.com/kamui/retriable - v2.0.1
- Add support for ruby 1.9.3.
- Ruby
Published by kamui 21 days ago
https://github.com/kamui/retriable - v2.0.0.beta5
- Change
:max_triesback to:tries.
- Ruby
Published by kamui 21 days ago
https://github.com/kamui/retriable - v2.0.0.beta4
- Change #retry back to #retriable. Didn't like the idea of defining a method that is also a reserved word.
- Add ability for
:onargument to accept aHashwhere the keys are exception types and the values are a single or array ofRegexppattern(s) to match against exception messages for retrial.
- Ruby
Published by kamui 21 days ago
https://github.com/kamui/retriable - v2.0.0.beta3
- Accept
intervalsarray argument to provide your own custom intervals. - Refactor the exponential backoff code into it's own class.
- Add specs for exponential backoff, randomization, and config.
- Ruby
Published by kamui 21 days ago
https://github.com/kamui/retriable - v2.0.0.beta2
- Raise, not return, on max elapsed time.
- Check for elapsed time after next interval is calculated and it goes over the max elapsed time.
- Add specs for
max_elapsed_timeandmax_interval.
- Ruby
Published by kamui 21 days ago
https://github.com/kamui/retriable - v2.0.0.beta1
- Require ruby 2.0+.
- Default to random exponential backoff, removes the
intervaloption. Exponential backoff is configurable via arguments. - Allow configurable defaults via
Retriable#configureblock. - Change
Retriable.retriabletoRetriable.retry. - Support early termination via
max_elapsed_timeargument.
- Ruby
Published by kamui 21 days ago
https://github.com/kamui/retriable - v2.0.0
- Require ruby 2.0+.
- Time intervals default to randomized exponential backoff instead of fixed time intervals. The delay between retries grows with every attempt and there's a randomization factor added to each attempt.
base_interval,max_interval,rand_factor, andmultiplierare new arguments that are used to generate randomized exponential back off time intervals.intervalargument removed.- Accept
intervalsarray argument to provide your own custom intervals. - Allow configurable defaults via
Retriable#configureblock. - Add ability for
:onargument to accept aHashwhere the keys are exception types and the values are a single or array ofRegexppattern(s) to match against exception messages for retrial. - Raise, not return, on max elapsed time.
- Check for elapsed time after next interval is calculated and it goes over the max elapsed time.
- Support early termination via
max_elapsed_timeargument.
- Ruby
Published by kamui 21 days ago
https://github.com/kamui/retriable - v1.4.1
- Fixes non kernel mode bug. Remove DSL class, move
#retriableinto Retriable module. Thanks @mkrogemann.
- Ruby
Published by kamui 21 days ago
https://github.com/kamui/retriable - v1.4.0
- By default, retriable doesn't monkey patch
Kernel. If you want this functionality,
you can `require 'retriable/core_ext/kernel'. - Upgrade minitest to 5.x.
- Refactor the DSL into it's own class.
- Ruby
Published by kamui 21 days ago
https://github.com/kamui/retriable - v1.3.3.1
- Allow sleep parameter to be a proc/lambda to allow for exponential backoff.
- Ruby
Published by kamui 21 days ago
https://github.com/kamui/retriable - v1.3.3
- sleep after executing the retry block, so there's no wait on the first call (molfar)
- Ruby
Published by kamui 21 days ago
https://github.com/kamui/retriable - v1.3.2
- Clean up option defaults.
- By default, rescue StandardError and Timeout::Error instead of Exception.
- Ruby
Published by kamui 21 days ago
https://github.com/kamui/retriable - v1.3.1
- Add
rakedependency for travis-ci. - Update gemspec summary and description.
- Ruby
Published by kamui 21 days ago
https://github.com/kamui/retriable - v1.3.0
- Rewrote a lot of the code with inspiration from attempt.
- Add timeout option to the code block.
- Include in Kernel by default, but allow require 'retriable/no_kernel' to load a non kernel version.
- Renamed
:timesoption to:tries. - Renamed
:sleepoption to:interval. - Renamed
:thenoption to:on_retry. - Removed other callbacks, you can wrap retriable in a begin/rescue/else/ensure block if you need that functionality. It avoids the need to define multiple Procs and makes the code more readable.
- Rewrote most of the README
- Ruby
Published by kamui 21 days ago
https://github.com/kamui/retriable - v1.2.0
- Forked the retryable-rb repo.
- Extend the Kernel module with the retriable method so you can use it anywhere without having to include it in every class.
- Update gemspec, Gemfile, and Raketask.
- Remove echoe dependency.
- Ruby
Published by kamui 21 days ago