attio 0.1.1
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 +7 -0
- data/.codecov.yml +52 -0
- data/.github/CODEOWNERS +28 -0
- data/.github/ISSUE_TEMPLATE/bug_report.md +40 -0
- data/.github/ISSUE_TEMPLATE/feature_request.md +28 -0
- data/.github/dependabot.yml +54 -0
- data/.github/pull_request_template.md +40 -0
- data/.github/workflows/ci.yml +112 -0
- data/.github/workflows/dependabot-auto-merge.yml +45 -0
- data/.github/workflows/pr_checks.yml +145 -0
- data/.github/workflows/release.yml +147 -0
- data/.gitignore +10 -0
- data/.rspec +4 -0
- data/.rubocop.yml +133 -0
- data/.yardopts +18 -0
- data/CHANGELOG.md +34 -0
- data/CODE_OF_CONDUCT.md +37 -0
- data/CONTRIBUTING.md +280 -0
- data/Gemfile +17 -0
- data/Gemfile.lock +127 -0
- data/LICENSE.txt +21 -0
- data/README.md +292 -0
- data/Rakefile +57 -0
- data/SECURITY.md +59 -0
- data/attio.gemspec +34 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/danger/Dangerfile +121 -0
- data/docs/.nojekyll +0 -0
- data/docs/Attio/AuthenticationError.html +152 -0
- data/docs/Attio/Client.html +1373 -0
- data/docs/Attio/ConnectionPool/TimeoutError.html +148 -0
- data/docs/Attio/ConnectionPool.html +944 -0
- data/docs/Attio/Error.html +152 -0
- data/docs/Attio/HttpClient/ConnectionError.html +152 -0
- data/docs/Attio/HttpClient/TimeoutError.html +152 -0
- data/docs/Attio/HttpClient.html +1329 -0
- data/docs/Attio/Logger.html +747 -0
- data/docs/Attio/NotFoundError.html +152 -0
- data/docs/Attio/RateLimitError.html +152 -0
- data/docs/Attio/RequestLogger.html +780 -0
- data/docs/Attio/Resources/Attributes.html +508 -0
- data/docs/Attio/Resources/Base.html +624 -0
- data/docs/Attio/Resources/Lists.html +1002 -0
- data/docs/Attio/Resources/Objects.html +415 -0
- data/docs/Attio/Resources/Records.html +1465 -0
- data/docs/Attio/Resources/Users.html +415 -0
- data/docs/Attio/Resources/Workspaces.html +324 -0
- data/docs/Attio/Resources.html +141 -0
- data/docs/Attio/RetryHandler.html +1023 -0
- data/docs/Attio/ServerError.html +152 -0
- data/docs/Attio/ValidationError.html +152 -0
- data/docs/Attio.html +397 -0
- data/docs/SETUP.md +117 -0
- data/docs/_index.html +378 -0
- data/docs/class_list.html +54 -0
- data/docs/css/common.css +1 -0
- data/docs/css/full_list.css +58 -0
- data/docs/css/style.css +503 -0
- data/docs/example.rb +119 -0
- data/docs/file.CHANGELOG.html +124 -0
- data/docs/file.README.html +371 -0
- data/docs/file_list.html +64 -0
- data/docs/frames.html +22 -0
- data/docs/index.html +371 -0
- data/docs/js/app.js +344 -0
- data/docs/js/full_list.js +242 -0
- data/docs/js/jquery.js +4 -0
- data/docs/method_list.html +750 -0
- data/docs/top-level-namespace.html +110 -0
- data/lib/attio/client.rb +118 -0
- data/lib/attio/connection_pool.rb +69 -0
- data/lib/attio/errors.rb +9 -0
- data/lib/attio/http_client.rb +100 -0
- data/lib/attio/logger.rb +110 -0
- data/lib/attio/resources/attributes.rb +26 -0
- data/lib/attio/resources/base.rb +55 -0
- data/lib/attio/resources/lists.rb +56 -0
- data/lib/attio/resources/objects.rb +20 -0
- data/lib/attio/resources/records.rb +158 -0
- data/lib/attio/resources/users.rb +20 -0
- data/lib/attio/resources/workspaces.rb +13 -0
- data/lib/attio/retry_handler.rb +70 -0
- data/lib/attio/version.rb +3 -0
- data/lib/attio.rb +60 -0
- data/run_tests.rb +52 -0
- data/test_basic.rb +51 -0
- data/test_typhoeus.rb +31 -0
- metadata +160 -0
@@ -0,0 +1,1023 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
Class: Attio::RetryHandler
|
8
|
+
|
9
|
+
— Attio Ruby Client Documentation
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" />
|
16
|
+
|
17
|
+
<script type="text/javascript">
|
18
|
+
pathId = "Attio::RetryHandler";
|
19
|
+
relpath = '../';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="../class_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="../_index.html">Index (R)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../Attio.html" title="Attio (module)">Attio</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">RetryHandler</span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="search">
|
47
|
+
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
49
|
+
href="../class_list.html">
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<div id="content"><h1>Class: Attio::RetryHandler
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
<dl>
|
70
|
+
<dt>Inherits:</dt>
|
71
|
+
<dd>
|
72
|
+
<span class="inheritName">Object</span>
|
73
|
+
|
74
|
+
<ul class="fullTree">
|
75
|
+
<li>Object</li>
|
76
|
+
|
77
|
+
<li class="next">Attio::RetryHandler</li>
|
78
|
+
|
79
|
+
</ul>
|
80
|
+
<a href="#" class="inheritanceTree">show all</a>
|
81
|
+
|
82
|
+
</dd>
|
83
|
+
</dl>
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
<dl>
|
96
|
+
<dt>Defined in:</dt>
|
97
|
+
<dd>lib/attio/retry_handler.rb</dd>
|
98
|
+
</dl>
|
99
|
+
|
100
|
+
</div>
|
101
|
+
|
102
|
+
<h2>Overview</h2><div class="docstring">
|
103
|
+
<div class="discussion">
|
104
|
+
|
105
|
+
|
106
|
+
</div>
|
107
|
+
</div>
|
108
|
+
<div class="tags">
|
109
|
+
|
110
|
+
<p class="tag_title">Since:</p>
|
111
|
+
<ul class="since">
|
112
|
+
|
113
|
+
<li>
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
<div class='inline'><p>1.0.0</p>
|
120
|
+
</div>
|
121
|
+
|
122
|
+
</li>
|
123
|
+
|
124
|
+
</ul>
|
125
|
+
|
126
|
+
</div>
|
127
|
+
|
128
|
+
<h2>
|
129
|
+
Constant Summary
|
130
|
+
<small><a href="#" class="constants_summary_toggle">collapse</a></small>
|
131
|
+
</h2>
|
132
|
+
|
133
|
+
<dl class="constants">
|
134
|
+
|
135
|
+
<dt id="DEFAULT_MAX_RETRIES-constant" class="">DEFAULT_MAX_RETRIES =
|
136
|
+
<div class="docstring">
|
137
|
+
<div class="discussion">
|
138
|
+
|
139
|
+
|
140
|
+
</div>
|
141
|
+
</div>
|
142
|
+
<div class="tags">
|
143
|
+
|
144
|
+
<p class="tag_title">Since:</p>
|
145
|
+
<ul class="since">
|
146
|
+
|
147
|
+
<li>
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
<div class='inline'><p>1.0.0</p>
|
154
|
+
</div>
|
155
|
+
|
156
|
+
</li>
|
157
|
+
|
158
|
+
</ul>
|
159
|
+
|
160
|
+
</div>
|
161
|
+
</dt>
|
162
|
+
<dd><pre class="code"><span class='int'>3</span></pre></dd>
|
163
|
+
|
164
|
+
<dt id="DEFAULT_RETRY_DELAY-constant" class="">DEFAULT_RETRY_DELAY =
|
165
|
+
<div class="docstring">
|
166
|
+
<div class="discussion">
|
167
|
+
<p>seconds</p>
|
168
|
+
|
169
|
+
|
170
|
+
</div>
|
171
|
+
</div>
|
172
|
+
<div class="tags">
|
173
|
+
|
174
|
+
<p class="tag_title">Since:</p>
|
175
|
+
<ul class="since">
|
176
|
+
|
177
|
+
<li>
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
<div class='inline'><p>1.0.0</p>
|
184
|
+
</div>
|
185
|
+
|
186
|
+
</li>
|
187
|
+
|
188
|
+
</ul>
|
189
|
+
|
190
|
+
</div>
|
191
|
+
</dt>
|
192
|
+
<dd><pre class="code"><span class='int'>1</span></pre></dd>
|
193
|
+
|
194
|
+
<dt id="DEFAULT_BACKOFF_FACTOR-constant" class="">DEFAULT_BACKOFF_FACTOR =
|
195
|
+
<div class="docstring">
|
196
|
+
<div class="discussion">
|
197
|
+
|
198
|
+
|
199
|
+
</div>
|
200
|
+
</div>
|
201
|
+
<div class="tags">
|
202
|
+
|
203
|
+
<p class="tag_title">Since:</p>
|
204
|
+
<ul class="since">
|
205
|
+
|
206
|
+
<li>
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
<div class='inline'><p>1.0.0</p>
|
213
|
+
</div>
|
214
|
+
|
215
|
+
</li>
|
216
|
+
|
217
|
+
</ul>
|
218
|
+
|
219
|
+
</div>
|
220
|
+
</dt>
|
221
|
+
<dd><pre class="code"><span class='int'>2</span></pre></dd>
|
222
|
+
|
223
|
+
<dt id="RETRIABLE_ERRORS-constant" class="">RETRIABLE_ERRORS =
|
224
|
+
<div class="docstring">
|
225
|
+
<div class="discussion">
|
226
|
+
|
227
|
+
|
228
|
+
</div>
|
229
|
+
</div>
|
230
|
+
<div class="tags">
|
231
|
+
|
232
|
+
<p class="tag_title">Since:</p>
|
233
|
+
<ul class="since">
|
234
|
+
|
235
|
+
<li>
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
<div class='inline'><p>1.0.0</p>
|
242
|
+
</div>
|
243
|
+
|
244
|
+
</li>
|
245
|
+
|
246
|
+
</ul>
|
247
|
+
|
248
|
+
</div>
|
249
|
+
</dt>
|
250
|
+
<dd><pre class="code"><span class='lbracket'>[</span>
|
251
|
+
<span class='const'><span class='object_link'><a href="HttpClient.html" title="Attio::HttpClient (class)">HttpClient</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="HttpClient/TimeoutError.html" title="Attio::HttpClient::TimeoutError (class)">TimeoutError</a></span></span><span class='comma'>,</span>
|
252
|
+
<span class='const'><span class='object_link'><a href="HttpClient.html" title="Attio::HttpClient (class)">HttpClient</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="HttpClient/ConnectionError.html" title="Attio::HttpClient::ConnectionError (class)">ConnectionError</a></span></span><span class='comma'>,</span>
|
253
|
+
<span class='const'><span class='object_link'><a href="ServerError.html" title="Attio::ServerError (class)">ServerError</a></span></span><span class='comma'>,</span>
|
254
|
+
<span class='const'><span class='object_link'><a href="RateLimitError.html" title="Attio::RateLimitError (class)">RateLimitError</a></span></span>
|
255
|
+
<span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
|
256
|
+
|
257
|
+
</dl>
|
258
|
+
|
259
|
+
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
<h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
|
264
|
+
<ul class="summary">
|
265
|
+
|
266
|
+
<li class="public ">
|
267
|
+
<span class="summary_signature">
|
268
|
+
|
269
|
+
<a href="#backoff_factor-instance_method" title="#backoff_factor (instance method)">#<strong>backoff_factor</strong> ⇒ Object </a>
|
270
|
+
|
271
|
+
|
272
|
+
|
273
|
+
</span>
|
274
|
+
|
275
|
+
|
276
|
+
|
277
|
+
|
278
|
+
<span class="note title readonly">readonly</span>
|
279
|
+
|
280
|
+
|
281
|
+
|
282
|
+
|
283
|
+
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
|
288
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
289
|
+
|
290
|
+
</li>
|
291
|
+
|
292
|
+
|
293
|
+
<li class="public ">
|
294
|
+
<span class="summary_signature">
|
295
|
+
|
296
|
+
<a href="#logger-instance_method" title="#logger (instance method)">#<strong>logger</strong> ⇒ Object </a>
|
297
|
+
|
298
|
+
|
299
|
+
|
300
|
+
</span>
|
301
|
+
|
302
|
+
|
303
|
+
|
304
|
+
|
305
|
+
<span class="note title readonly">readonly</span>
|
306
|
+
|
307
|
+
|
308
|
+
|
309
|
+
|
310
|
+
|
311
|
+
|
312
|
+
|
313
|
+
|
314
|
+
|
315
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
316
|
+
|
317
|
+
</li>
|
318
|
+
|
319
|
+
|
320
|
+
<li class="public ">
|
321
|
+
<span class="summary_signature">
|
322
|
+
|
323
|
+
<a href="#max_retries-instance_method" title="#max_retries (instance method)">#<strong>max_retries</strong> ⇒ Object </a>
|
324
|
+
|
325
|
+
|
326
|
+
|
327
|
+
</span>
|
328
|
+
|
329
|
+
|
330
|
+
|
331
|
+
|
332
|
+
<span class="note title readonly">readonly</span>
|
333
|
+
|
334
|
+
|
335
|
+
|
336
|
+
|
337
|
+
|
338
|
+
|
339
|
+
|
340
|
+
|
341
|
+
|
342
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
343
|
+
|
344
|
+
</li>
|
345
|
+
|
346
|
+
|
347
|
+
<li class="public ">
|
348
|
+
<span class="summary_signature">
|
349
|
+
|
350
|
+
<a href="#retry_delay-instance_method" title="#retry_delay (instance method)">#<strong>retry_delay</strong> ⇒ Object </a>
|
351
|
+
|
352
|
+
|
353
|
+
|
354
|
+
</span>
|
355
|
+
|
356
|
+
|
357
|
+
|
358
|
+
|
359
|
+
<span class="note title readonly">readonly</span>
|
360
|
+
|
361
|
+
|
362
|
+
|
363
|
+
|
364
|
+
|
365
|
+
|
366
|
+
|
367
|
+
|
368
|
+
|
369
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
370
|
+
|
371
|
+
</li>
|
372
|
+
|
373
|
+
|
374
|
+
</ul>
|
375
|
+
|
376
|
+
|
377
|
+
|
378
|
+
|
379
|
+
|
380
|
+
<h2>
|
381
|
+
Instance Method Summary
|
382
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
383
|
+
</h2>
|
384
|
+
|
385
|
+
<ul class="summary">
|
386
|
+
|
387
|
+
<li class="public ">
|
388
|
+
<span class="summary_signature">
|
389
|
+
|
390
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(max_retries: DEFAULT_MAX_RETRIES, retry_delay: DEFAULT_RETRY_DELAY, backoff_factor: DEFAULT_BACKOFF_FACTOR, logger: nil) ⇒ RetryHandler </a>
|
391
|
+
|
392
|
+
|
393
|
+
|
394
|
+
</span>
|
395
|
+
|
396
|
+
|
397
|
+
<span class="note title constructor">constructor</span>
|
398
|
+
|
399
|
+
|
400
|
+
|
401
|
+
|
402
|
+
|
403
|
+
|
404
|
+
|
405
|
+
|
406
|
+
<span class="summary_desc"><div class='inline'><p>A new instance of RetryHandler.</p>
|
407
|
+
</div></span>
|
408
|
+
|
409
|
+
</li>
|
410
|
+
|
411
|
+
|
412
|
+
<li class="private ">
|
413
|
+
<span class="summary_signature">
|
414
|
+
|
415
|
+
<a href="#log_failure-instance_method" title="#log_failure (instance method)">#<strong>log_failure</strong>(error, attempts) ⇒ Object </a>
|
416
|
+
|
417
|
+
|
418
|
+
|
419
|
+
</span>
|
420
|
+
|
421
|
+
|
422
|
+
|
423
|
+
<span class="note title private">private</span>
|
424
|
+
|
425
|
+
|
426
|
+
|
427
|
+
|
428
|
+
|
429
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
430
|
+
|
431
|
+
</li>
|
432
|
+
|
433
|
+
|
434
|
+
<li class="private ">
|
435
|
+
<span class="summary_signature">
|
436
|
+
|
437
|
+
<a href="#log_retry-instance_method" title="#log_retry (instance method)">#<strong>log_retry</strong>(error, attempt, delay) ⇒ Object </a>
|
438
|
+
|
439
|
+
|
440
|
+
|
441
|
+
</span>
|
442
|
+
|
443
|
+
|
444
|
+
|
445
|
+
<span class="note title private">private</span>
|
446
|
+
|
447
|
+
|
448
|
+
|
449
|
+
|
450
|
+
|
451
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
452
|
+
|
453
|
+
</li>
|
454
|
+
|
455
|
+
|
456
|
+
<li class="public ">
|
457
|
+
<span class="summary_signature">
|
458
|
+
|
459
|
+
<a href="#with_retry-instance_method" title="#with_retry (instance method)">#<strong>with_retry</strong>(&block) ⇒ Object </a>
|
460
|
+
|
461
|
+
|
462
|
+
|
463
|
+
</span>
|
464
|
+
|
465
|
+
|
466
|
+
|
467
|
+
|
468
|
+
|
469
|
+
|
470
|
+
|
471
|
+
|
472
|
+
|
473
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
474
|
+
|
475
|
+
</li>
|
476
|
+
|
477
|
+
|
478
|
+
</ul>
|
479
|
+
|
480
|
+
|
481
|
+
<div id="constructor_details" class="method_details_list">
|
482
|
+
<h2>Constructor Details</h2>
|
483
|
+
|
484
|
+
<div class="method_details first">
|
485
|
+
<h3 class="signature first" id="initialize-instance_method">
|
486
|
+
|
487
|
+
#<strong>initialize</strong>(max_retries: DEFAULT_MAX_RETRIES, retry_delay: DEFAULT_RETRY_DELAY, backoff_factor: DEFAULT_BACKOFF_FACTOR, logger: nil) ⇒ <tt><span class='object_link'><a href="" title="Attio::RetryHandler (class)">RetryHandler</a></span></tt>
|
488
|
+
|
489
|
+
|
490
|
+
|
491
|
+
|
492
|
+
|
493
|
+
</h3><div class="docstring">
|
494
|
+
<div class="discussion">
|
495
|
+
<p>Returns a new instance of RetryHandler.</p>
|
496
|
+
|
497
|
+
|
498
|
+
</div>
|
499
|
+
</div>
|
500
|
+
<div class="tags">
|
501
|
+
|
502
|
+
<p class="tag_title">Since:</p>
|
503
|
+
<ul class="since">
|
504
|
+
|
505
|
+
<li>
|
506
|
+
|
507
|
+
|
508
|
+
|
509
|
+
|
510
|
+
|
511
|
+
<div class='inline'><p>1.0.0</p>
|
512
|
+
</div>
|
513
|
+
|
514
|
+
</li>
|
515
|
+
|
516
|
+
</ul>
|
517
|
+
|
518
|
+
</div><table class="source_code">
|
519
|
+
<tr>
|
520
|
+
<td>
|
521
|
+
<pre class="lines">
|
522
|
+
|
523
|
+
|
524
|
+
15
|
525
|
+
16
|
526
|
+
17
|
527
|
+
18
|
528
|
+
19
|
529
|
+
20
|
530
|
+
21
|
531
|
+
22
|
532
|
+
23</pre>
|
533
|
+
</td>
|
534
|
+
<td>
|
535
|
+
<pre class="code"><span class="info file"># File 'lib/attio/retry_handler.rb', line 15</span>
|
536
|
+
|
537
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='label'>max_retries:</span> <span class='const'><span class='object_link'><a href="#DEFAULT_MAX_RETRIES-constant" title="Attio::RetryHandler::DEFAULT_MAX_RETRIES (constant)">DEFAULT_MAX_RETRIES</a></span></span><span class='comma'>,</span>
|
538
|
+
<span class='label'>retry_delay:</span> <span class='const'><span class='object_link'><a href="#DEFAULT_RETRY_DELAY-constant" title="Attio::RetryHandler::DEFAULT_RETRY_DELAY (constant)">DEFAULT_RETRY_DELAY</a></span></span><span class='comma'>,</span>
|
539
|
+
<span class='label'>backoff_factor:</span> <span class='const'><span class='object_link'><a href="#DEFAULT_BACKOFF_FACTOR-constant" title="Attio::RetryHandler::DEFAULT_BACKOFF_FACTOR (constant)">DEFAULT_BACKOFF_FACTOR</a></span></span><span class='comma'>,</span>
|
540
|
+
<span class='label'>logger:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
541
|
+
<span class='ivar'>@max_retries</span> <span class='op'>=</span> <span class='id identifier rubyid_max_retries'>max_retries</span>
|
542
|
+
<span class='ivar'>@retry_delay</span> <span class='op'>=</span> <span class='id identifier rubyid_retry_delay'>retry_delay</span>
|
543
|
+
<span class='ivar'>@backoff_factor</span> <span class='op'>=</span> <span class='id identifier rubyid_backoff_factor'>backoff_factor</span>
|
544
|
+
<span class='ivar'>@logger</span> <span class='op'>=</span> <span class='id identifier rubyid_logger'>logger</span>
|
545
|
+
<span class='kw'>end</span></pre>
|
546
|
+
</td>
|
547
|
+
</tr>
|
548
|
+
</table>
|
549
|
+
</div>
|
550
|
+
|
551
|
+
</div>
|
552
|
+
|
553
|
+
<div id="instance_attr_details" class="attr_details">
|
554
|
+
<h2>Instance Attribute Details</h2>
|
555
|
+
|
556
|
+
|
557
|
+
<span id=""></span>
|
558
|
+
<div class="method_details first">
|
559
|
+
<h3 class="signature first" id="backoff_factor-instance_method">
|
560
|
+
|
561
|
+
#<strong>backoff_factor</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
562
|
+
|
563
|
+
|
564
|
+
|
565
|
+
|
566
|
+
|
567
|
+
</h3><div class="docstring">
|
568
|
+
<div class="discussion">
|
569
|
+
|
570
|
+
|
571
|
+
</div>
|
572
|
+
</div>
|
573
|
+
<div class="tags">
|
574
|
+
|
575
|
+
<p class="tag_title">Since:</p>
|
576
|
+
<ul class="since">
|
577
|
+
|
578
|
+
<li>
|
579
|
+
|
580
|
+
|
581
|
+
|
582
|
+
|
583
|
+
|
584
|
+
<div class='inline'><p>1.0.0</p>
|
585
|
+
</div>
|
586
|
+
|
587
|
+
</li>
|
588
|
+
|
589
|
+
</ul>
|
590
|
+
|
591
|
+
</div><table class="source_code">
|
592
|
+
<tr>
|
593
|
+
<td>
|
594
|
+
<pre class="lines">
|
595
|
+
|
596
|
+
|
597
|
+
13
|
598
|
+
14
|
599
|
+
15</pre>
|
600
|
+
</td>
|
601
|
+
<td>
|
602
|
+
<pre class="code"><span class="info file"># File 'lib/attio/retry_handler.rb', line 13</span>
|
603
|
+
|
604
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_backoff_factor'>backoff_factor</span>
|
605
|
+
<span class='ivar'>@backoff_factor</span>
|
606
|
+
<span class='kw'>end</span></pre>
|
607
|
+
</td>
|
608
|
+
</tr>
|
609
|
+
</table>
|
610
|
+
</div>
|
611
|
+
|
612
|
+
|
613
|
+
<span id=""></span>
|
614
|
+
<div class="method_details ">
|
615
|
+
<h3 class="signature " id="logger-instance_method">
|
616
|
+
|
617
|
+
#<strong>logger</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
618
|
+
|
619
|
+
|
620
|
+
|
621
|
+
|
622
|
+
|
623
|
+
</h3><div class="docstring">
|
624
|
+
<div class="discussion">
|
625
|
+
|
626
|
+
|
627
|
+
</div>
|
628
|
+
</div>
|
629
|
+
<div class="tags">
|
630
|
+
|
631
|
+
<p class="tag_title">Since:</p>
|
632
|
+
<ul class="since">
|
633
|
+
|
634
|
+
<li>
|
635
|
+
|
636
|
+
|
637
|
+
|
638
|
+
|
639
|
+
|
640
|
+
<div class='inline'><p>1.0.0</p>
|
641
|
+
</div>
|
642
|
+
|
643
|
+
</li>
|
644
|
+
|
645
|
+
</ul>
|
646
|
+
|
647
|
+
</div><table class="source_code">
|
648
|
+
<tr>
|
649
|
+
<td>
|
650
|
+
<pre class="lines">
|
651
|
+
|
652
|
+
|
653
|
+
13
|
654
|
+
14
|
655
|
+
15</pre>
|
656
|
+
</td>
|
657
|
+
<td>
|
658
|
+
<pre class="code"><span class="info file"># File 'lib/attio/retry_handler.rb', line 13</span>
|
659
|
+
|
660
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_logger'>logger</span>
|
661
|
+
<span class='ivar'>@logger</span>
|
662
|
+
<span class='kw'>end</span></pre>
|
663
|
+
</td>
|
664
|
+
</tr>
|
665
|
+
</table>
|
666
|
+
</div>
|
667
|
+
|
668
|
+
|
669
|
+
<span id=""></span>
|
670
|
+
<div class="method_details ">
|
671
|
+
<h3 class="signature " id="max_retries-instance_method">
|
672
|
+
|
673
|
+
#<strong>max_retries</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
674
|
+
|
675
|
+
|
676
|
+
|
677
|
+
|
678
|
+
|
679
|
+
</h3><div class="docstring">
|
680
|
+
<div class="discussion">
|
681
|
+
|
682
|
+
|
683
|
+
</div>
|
684
|
+
</div>
|
685
|
+
<div class="tags">
|
686
|
+
|
687
|
+
<p class="tag_title">Since:</p>
|
688
|
+
<ul class="since">
|
689
|
+
|
690
|
+
<li>
|
691
|
+
|
692
|
+
|
693
|
+
|
694
|
+
|
695
|
+
|
696
|
+
<div class='inline'><p>1.0.0</p>
|
697
|
+
</div>
|
698
|
+
|
699
|
+
</li>
|
700
|
+
|
701
|
+
</ul>
|
702
|
+
|
703
|
+
</div><table class="source_code">
|
704
|
+
<tr>
|
705
|
+
<td>
|
706
|
+
<pre class="lines">
|
707
|
+
|
708
|
+
|
709
|
+
13
|
710
|
+
14
|
711
|
+
15</pre>
|
712
|
+
</td>
|
713
|
+
<td>
|
714
|
+
<pre class="code"><span class="info file"># File 'lib/attio/retry_handler.rb', line 13</span>
|
715
|
+
|
716
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_max_retries'>max_retries</span>
|
717
|
+
<span class='ivar'>@max_retries</span>
|
718
|
+
<span class='kw'>end</span></pre>
|
719
|
+
</td>
|
720
|
+
</tr>
|
721
|
+
</table>
|
722
|
+
</div>
|
723
|
+
|
724
|
+
|
725
|
+
<span id=""></span>
|
726
|
+
<div class="method_details ">
|
727
|
+
<h3 class="signature " id="retry_delay-instance_method">
|
728
|
+
|
729
|
+
#<strong>retry_delay</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
730
|
+
|
731
|
+
|
732
|
+
|
733
|
+
|
734
|
+
|
735
|
+
</h3><div class="docstring">
|
736
|
+
<div class="discussion">
|
737
|
+
|
738
|
+
|
739
|
+
</div>
|
740
|
+
</div>
|
741
|
+
<div class="tags">
|
742
|
+
|
743
|
+
<p class="tag_title">Since:</p>
|
744
|
+
<ul class="since">
|
745
|
+
|
746
|
+
<li>
|
747
|
+
|
748
|
+
|
749
|
+
|
750
|
+
|
751
|
+
|
752
|
+
<div class='inline'><p>1.0.0</p>
|
753
|
+
</div>
|
754
|
+
|
755
|
+
</li>
|
756
|
+
|
757
|
+
</ul>
|
758
|
+
|
759
|
+
</div><table class="source_code">
|
760
|
+
<tr>
|
761
|
+
<td>
|
762
|
+
<pre class="lines">
|
763
|
+
|
764
|
+
|
765
|
+
13
|
766
|
+
14
|
767
|
+
15</pre>
|
768
|
+
</td>
|
769
|
+
<td>
|
770
|
+
<pre class="code"><span class="info file"># File 'lib/attio/retry_handler.rb', line 13</span>
|
771
|
+
|
772
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_retry_delay'>retry_delay</span>
|
773
|
+
<span class='ivar'>@retry_delay</span>
|
774
|
+
<span class='kw'>end</span></pre>
|
775
|
+
</td>
|
776
|
+
</tr>
|
777
|
+
</table>
|
778
|
+
</div>
|
779
|
+
|
780
|
+
</div>
|
781
|
+
|
782
|
+
|
783
|
+
<div id="instance_method_details" class="method_details_list">
|
784
|
+
<h2>Instance Method Details</h2>
|
785
|
+
|
786
|
+
|
787
|
+
<div class="method_details first">
|
788
|
+
<h3 class="signature first" id="log_failure-instance_method">
|
789
|
+
|
790
|
+
#<strong>log_failure</strong>(error, attempts) ⇒ <tt>Object</tt> <span class="extras">(private)</span>
|
791
|
+
|
792
|
+
|
793
|
+
|
794
|
+
|
795
|
+
|
796
|
+
</h3><div class="docstring">
|
797
|
+
<div class="discussion">
|
798
|
+
|
799
|
+
|
800
|
+
</div>
|
801
|
+
</div>
|
802
|
+
<div class="tags">
|
803
|
+
|
804
|
+
<p class="tag_title">Since:</p>
|
805
|
+
<ul class="since">
|
806
|
+
|
807
|
+
<li>
|
808
|
+
|
809
|
+
|
810
|
+
|
811
|
+
|
812
|
+
|
813
|
+
<div class='inline'><p>1.0.0</p>
|
814
|
+
</div>
|
815
|
+
|
816
|
+
</li>
|
817
|
+
|
818
|
+
</ul>
|
819
|
+
|
820
|
+
</div><table class="source_code">
|
821
|
+
<tr>
|
822
|
+
<td>
|
823
|
+
<pre class="lines">
|
824
|
+
|
825
|
+
|
826
|
+
59
|
827
|
+
60
|
828
|
+
61
|
829
|
+
62
|
830
|
+
63
|
831
|
+
64
|
832
|
+
65
|
833
|
+
66
|
834
|
+
67
|
835
|
+
68</pre>
|
836
|
+
</td>
|
837
|
+
<td>
|
838
|
+
<pre class="code"><span class="info file"># File 'lib/attio/retry_handler.rb', line 59</span>
|
839
|
+
|
840
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_log_failure'>log_failure</span><span class='lparen'>(</span><span class='id identifier rubyid_error'>error</span><span class='comma'>,</span> <span class='id identifier rubyid_attempts'>attempts</span><span class='rparen'>)</span>
|
841
|
+
<span class='kw'>return</span> <span class='kw'>unless</span> <span class='id identifier rubyid_logger'>logger</span>
|
842
|
+
|
843
|
+
<span class='id identifier rubyid_logger'>logger</span><span class='period'>.</span><span class='id identifier rubyid_error'>error</span><span class='lparen'>(</span>
|
844
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Max retries exceeded</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
|
845
|
+
<span class='label'>error:</span> <span class='id identifier rubyid_error'>error</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span>
|
846
|
+
<span class='label'>message:</span> <span class='id identifier rubyid_error'>error</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span><span class='comma'>,</span>
|
847
|
+
<span class='label'>attempts:</span> <span class='id identifier rubyid_attempts'>attempts</span>
|
848
|
+
<span class='rparen'>)</span>
|
849
|
+
<span class='kw'>end</span></pre>
|
850
|
+
</td>
|
851
|
+
</tr>
|
852
|
+
</table>
|
853
|
+
</div>
|
854
|
+
|
855
|
+
<div class="method_details ">
|
856
|
+
<h3 class="signature " id="log_retry-instance_method">
|
857
|
+
|
858
|
+
#<strong>log_retry</strong>(error, attempt, delay) ⇒ <tt>Object</tt> <span class="extras">(private)</span>
|
859
|
+
|
860
|
+
|
861
|
+
|
862
|
+
|
863
|
+
|
864
|
+
</h3><div class="docstring">
|
865
|
+
<div class="discussion">
|
866
|
+
|
867
|
+
|
868
|
+
</div>
|
869
|
+
</div>
|
870
|
+
<div class="tags">
|
871
|
+
|
872
|
+
<p class="tag_title">Since:</p>
|
873
|
+
<ul class="since">
|
874
|
+
|
875
|
+
<li>
|
876
|
+
|
877
|
+
|
878
|
+
|
879
|
+
|
880
|
+
|
881
|
+
<div class='inline'><p>1.0.0</p>
|
882
|
+
</div>
|
883
|
+
|
884
|
+
</li>
|
885
|
+
|
886
|
+
</ul>
|
887
|
+
|
888
|
+
</div><table class="source_code">
|
889
|
+
<tr>
|
890
|
+
<td>
|
891
|
+
<pre class="lines">
|
892
|
+
|
893
|
+
|
894
|
+
48
|
895
|
+
49
|
896
|
+
50
|
897
|
+
51
|
898
|
+
52
|
899
|
+
53
|
900
|
+
54
|
901
|
+
55
|
902
|
+
56
|
903
|
+
57</pre>
|
904
|
+
</td>
|
905
|
+
<td>
|
906
|
+
<pre class="code"><span class="info file"># File 'lib/attio/retry_handler.rb', line 48</span>
|
907
|
+
|
908
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_log_retry'>log_retry</span><span class='lparen'>(</span><span class='id identifier rubyid_error'>error</span><span class='comma'>,</span> <span class='id identifier rubyid_attempt'>attempt</span><span class='comma'>,</span> <span class='id identifier rubyid_delay'>delay</span><span class='rparen'>)</span>
|
909
|
+
<span class='kw'>return</span> <span class='kw'>unless</span> <span class='id identifier rubyid_logger'>logger</span>
|
910
|
+
|
911
|
+
<span class='id identifier rubyid_logger'>logger</span><span class='period'>.</span><span class='id identifier rubyid_warn'>warn</span><span class='lparen'>(</span>
|
912
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Retry attempt </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_attempt'>attempt</span><span class='embexpr_end'>}</span><span class='tstring_content'>/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_max_retries'>max_retries</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
|
913
|
+
<span class='label'>error:</span> <span class='id identifier rubyid_error'>error</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span>
|
914
|
+
<span class='label'>message:</span> <span class='id identifier rubyid_error'>error</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span><span class='comma'>,</span>
|
915
|
+
<span class='label'>delay:</span> <span class='id identifier rubyid_delay'>delay</span>
|
916
|
+
<span class='rparen'>)</span>
|
917
|
+
<span class='kw'>end</span></pre>
|
918
|
+
</td>
|
919
|
+
</tr>
|
920
|
+
</table>
|
921
|
+
</div>
|
922
|
+
|
923
|
+
<div class="method_details ">
|
924
|
+
<h3 class="signature " id="with_retry-instance_method">
|
925
|
+
|
926
|
+
#<strong>with_retry</strong>(&block) ⇒ <tt>Object</tt>
|
927
|
+
|
928
|
+
|
929
|
+
|
930
|
+
|
931
|
+
|
932
|
+
</h3><div class="docstring">
|
933
|
+
<div class="discussion">
|
934
|
+
|
935
|
+
|
936
|
+
</div>
|
937
|
+
</div>
|
938
|
+
<div class="tags">
|
939
|
+
|
940
|
+
<p class="tag_title">Since:</p>
|
941
|
+
<ul class="since">
|
942
|
+
|
943
|
+
<li>
|
944
|
+
|
945
|
+
|
946
|
+
|
947
|
+
|
948
|
+
|
949
|
+
<div class='inline'><p>1.0.0</p>
|
950
|
+
</div>
|
951
|
+
|
952
|
+
</li>
|
953
|
+
|
954
|
+
</ul>
|
955
|
+
|
956
|
+
</div><table class="source_code">
|
957
|
+
<tr>
|
958
|
+
<td>
|
959
|
+
<pre class="lines">
|
960
|
+
|
961
|
+
|
962
|
+
25
|
963
|
+
26
|
964
|
+
27
|
965
|
+
28
|
966
|
+
29
|
967
|
+
30
|
968
|
+
31
|
969
|
+
32
|
970
|
+
33
|
971
|
+
34
|
972
|
+
35
|
973
|
+
36
|
974
|
+
37
|
975
|
+
38
|
976
|
+
39
|
977
|
+
40
|
978
|
+
41
|
979
|
+
42
|
980
|
+
43
|
981
|
+
44</pre>
|
982
|
+
</td>
|
983
|
+
<td>
|
984
|
+
<pre class="code"><span class="info file"># File 'lib/attio/retry_handler.rb', line 25</span>
|
985
|
+
|
986
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_with_retry'>with_retry</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
987
|
+
<span class='id identifier rubyid_retries'>retries</span> <span class='op'>=</span> <span class='int'>0</span>
|
988
|
+
<span class='id identifier rubyid_delay'>delay</span> <span class='op'>=</span> <span class='id identifier rubyid_retry_delay'>retry_delay</span>
|
989
|
+
|
990
|
+
<span class='kw'>begin</span>
|
991
|
+
<span class='kw'>yield</span>
|
992
|
+
<span class='kw'>rescue</span> <span class='op'>*</span><span class='const'><span class='object_link'><a href="#RETRIABLE_ERRORS-constant" title="Attio::RetryHandler::RETRIABLE_ERRORS (constant)">RETRIABLE_ERRORS</a></span></span> <span class='op'>=></span> <span class='id identifier rubyid_e'>e</span>
|
993
|
+
<span class='id identifier rubyid_retries'>retries</span> <span class='op'>+=</span> <span class='int'>1</span>
|
994
|
+
|
995
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_retries'>retries</span> <span class='op'><=</span> <span class='id identifier rubyid_max_retries'>max_retries</span>
|
996
|
+
<span class='id identifier rubyid_log_retry'>log_retry</span><span class='lparen'>(</span><span class='id identifier rubyid_e'>e</span><span class='comma'>,</span> <span class='id identifier rubyid_retries'>retries</span><span class='comma'>,</span> <span class='id identifier rubyid_delay'>delay</span><span class='rparen'>)</span>
|
997
|
+
<span class='id identifier rubyid_sleep'>sleep</span><span class='lparen'>(</span><span class='id identifier rubyid_delay'>delay</span><span class='rparen'>)</span>
|
998
|
+
<span class='id identifier rubyid_delay'>delay</span> <span class='op'>*=</span> <span class='id identifier rubyid_backoff_factor'>backoff_factor</span>
|
999
|
+
<span class='kw'>retry</span>
|
1000
|
+
<span class='kw'>else</span>
|
1001
|
+
<span class='id identifier rubyid_log_failure'>log_failure</span><span class='lparen'>(</span><span class='id identifier rubyid_e'>e</span><span class='comma'>,</span> <span class='id identifier rubyid_retries'>retries</span><span class='rparen'>)</span>
|
1002
|
+
<span class='id identifier rubyid_raise'>raise</span>
|
1003
|
+
<span class='kw'>end</span>
|
1004
|
+
<span class='kw'>end</span>
|
1005
|
+
<span class='kw'>end</span></pre>
|
1006
|
+
</td>
|
1007
|
+
</tr>
|
1008
|
+
</table>
|
1009
|
+
</div>
|
1010
|
+
|
1011
|
+
</div>
|
1012
|
+
|
1013
|
+
</div>
|
1014
|
+
|
1015
|
+
<div id="footer">
|
1016
|
+
Generated on Mon Aug 11 11:26:43 2025 by
|
1017
|
+
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1018
|
+
0.9.37 (ruby-3.4.5).
|
1019
|
+
</div>
|
1020
|
+
|
1021
|
+
</div>
|
1022
|
+
</body>
|
1023
|
+
</html>
|