exp_retry 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/Readme.md +14 -0
- data/exp-retry.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e98297bc0b70fe30317c7cf6f9fea3d724419c60
|
4
|
+
data.tar.gz: 13dd48c6714c1f30c7b9bceed6c9288aa3a0e27f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5cfb9099fb016055bcd3bb3ae0271df8287420410cfa5e2d07a4721a25515960500d6e894600cf3bd92230d423296af9d36dfbae367cf5092cdb866f80624fd7
|
7
|
+
data.tar.gz: 67b0d9c475079e690b777524186a5dc0ce6d36ebc91b9e327d49a9393fbacd463d0bf634036fbc24e3057029227cac5162e234a00dc4a2e750adcf16861a9d0b
|
data/Gemfile.lock
CHANGED
data/Readme.md
CHANGED
@@ -8,13 +8,27 @@ A simple exponential backoff retry wrapper.
|
|
8
8
|
|
9
9
|
## Usage
|
10
10
|
|
11
|
+
You can wrap a simple block to enable retries:
|
12
|
+
|
11
13
|
```ruby
|
12
14
|
ExpRetry.new.call do
|
13
15
|
something_unreliable
|
14
16
|
end
|
17
|
+
```
|
18
|
+
|
19
|
+
You can specify which exception class to allow retries for:
|
15
20
|
|
21
|
+
```ruby
|
16
22
|
ExpRetry.new.call(exception: SpecificError) do
|
17
23
|
something_generic # errors will surface immediately
|
18
24
|
something_specific # errors will trigger retries
|
19
25
|
end
|
20
26
|
```
|
27
|
+
|
28
|
+
You can specify how many retries to allow:
|
29
|
+
|
30
|
+
```ruby
|
31
|
+
ExpRetry.new.call(retries: 5) do
|
32
|
+
something_unreliable # will retry 5 times
|
33
|
+
end
|
34
|
+
```
|
data/exp-retry.gemspec
CHANGED