condux 0.2.0 → 0.2.2
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/lib/condux/event_transport.rb +7 -3
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 052d61dbc184949cc86984867dee9135c3865c92ba5eade015b4a084fb8776f7
|
|
4
|
+
data.tar.gz: a6dd5a430f682ab31fbe7d25575ff90d79052ca8630d9b2230a9eb703970739f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5105353a63e9517998dc1486708e9f4bccb2bc5edc5b43a0c231af1b445d2363b460d6037f2d6c02422fe1b6fa83444ef8cf9cf7478c4b186c6c33eeea198f55
|
|
7
|
+
data.tar.gz: 4583565d0507413ec03c47bd30db2b4fad0e0c6178e6dd92b145cb5d1c32c12fd99cfa99ee1b240f7adb2c3e931be1ac09dc7b864de099f078613ced25175a30
|
|
@@ -59,8 +59,12 @@ module Condux
|
|
|
59
59
|
status == 429 || status >= 500
|
|
60
60
|
end
|
|
61
61
|
|
|
62
|
-
# Honor Retry-After (seconds) on a 429
|
|
62
|
+
# Honor Retry-After (seconds) on a 429, else exponential backoff. Both paths are capped at
|
|
63
|
+
# MAX_BACKOFF_MS, at ONE return so a later branch cannot route past it: the SDK holds the caller's
|
|
64
|
+
# thread while it waits, so bounding that wait is its own obligation and not the relay's to set.
|
|
65
|
+
# Returns seconds.
|
|
63
66
|
def backoff_seconds(attempt, status, headers)
|
|
67
|
+
wanted_ms = BASE_BACKOFF_MS * (2**attempt)
|
|
64
68
|
if status == 429
|
|
65
69
|
retry_after = header(headers, "retry-after")
|
|
66
70
|
if retry_after && !retry_after.strip.empty?
|
|
@@ -69,10 +73,10 @@ module Condux
|
|
|
69
73
|
rescue ArgumentError, TypeError
|
|
70
74
|
nil
|
|
71
75
|
end
|
|
72
|
-
|
|
76
|
+
wanted_ms = [seconds, 0.0].max * 1000.0 if seconds
|
|
73
77
|
end
|
|
74
78
|
end
|
|
75
|
-
[
|
|
79
|
+
[wanted_ms, MAX_BACKOFF_MS].min / 1000.0
|
|
76
80
|
end
|
|
77
81
|
|
|
78
82
|
def header(headers, name)
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: condux
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Condux
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-09-
|
|
11
|
+
date: 2026-09-10 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: 'The Condux SDK for Ruby: report errors to a Condux relay with a resilient,
|
|
14
14
|
never-raising transport. Zero runtime dependencies (standard library only).'
|