Commit 21aaf61
committed
Add subject_delete_marker_ttl and limit_marker_ttl support with review fixes
Implements PR nats-io#814 feature (closes nats-io#725) with improvements from code review:
- Add subject_delete_marker_ttl field to StreamConfig with nanosecond
conversion in from_response/as_dict
- Add limit_marker_ttl field to KeyValueConfig, passed through to
StreamConfig in create_key_value
- Add headers field to KeyValue.Entry for accessing message metadata
- Detect TTL-expired markers via Nats-Marker-Reason header in watcher
Review improvements applied:
- Extract "Nats-Marker-Reason" and "MaxAge" magic strings to module
constants (NATS_MARKER_REASON, NATS_MARKER_MAX_AGE) in kv.py
- Add limit_marker_ttl nanosecond conversion in KeyValueConfig.as_dict()
for consistency with ttl field
- Use Dict[str, str] type annotation for Entry.headers instead of bare dict
- Add server version comments on KeyValueConfig.limit_marker_ttl
https://claude.ai/code/session_01MteA8J2yH3ky5Y6coBpEAf1 parent 531bcf4 commit 21aaf61
4 files changed
+89
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
346 | 346 | | |
347 | 347 | | |
348 | 348 | | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
349 | 353 | | |
350 | 354 | | |
351 | 355 | | |
352 | 356 | | |
| 357 | + | |
353 | 358 | | |
354 | 359 | | |
355 | 360 | | |
| |||
361 | 366 | | |
362 | 367 | | |
363 | 368 | | |
| 369 | + | |
364 | 370 | | |
365 | 371 | | |
366 | 372 | | |
| |||
748 | 754 | | |
749 | 755 | | |
750 | 756 | | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
751 | 761 | | |
752 | 762 | | |
753 | 763 | | |
| 764 | + | |
754 | 765 | | |
755 | 766 | | |
756 | 767 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1416 | 1416 | | |
1417 | 1417 | | |
1418 | 1418 | | |
| 1419 | + | |
1419 | 1420 | | |
1420 | 1421 | | |
1421 | 1422 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
| |||
86 | 88 | | |
87 | 89 | | |
88 | 90 | | |
| 91 | + | |
89 | 92 | | |
90 | 93 | | |
91 | 94 | | |
| |||
472 | 475 | | |
473 | 476 | | |
474 | 477 | | |
475 | | - | |
476 | | - | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
477 | 483 | | |
478 | 484 | | |
479 | 485 | | |
| |||
491 | 497 | | |
492 | 498 | | |
493 | 499 | | |
| 500 | + | |
494 | 501 | | |
495 | 502 | | |
496 | 503 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5160 | 5160 | | |
5161 | 5161 | | |
5162 | 5162 | | |
| 5163 | + | |
| 5164 | + | |
| 5165 | + | |
| 5166 | + | |
| 5167 | + | |
| 5168 | + | |
| 5169 | + | |
| 5170 | + | |
| 5171 | + | |
| 5172 | + | |
| 5173 | + | |
| 5174 | + | |
| 5175 | + | |
| 5176 | + | |
| 5177 | + | |
| 5178 | + | |
| 5179 | + | |
| 5180 | + | |
| 5181 | + | |
| 5182 | + | |
| 5183 | + | |
| 5184 | + | |
| 5185 | + | |
| 5186 | + | |
| 5187 | + | |
| 5188 | + | |
| 5189 | + | |
| 5190 | + | |
| 5191 | + | |
| 5192 | + | |
| 5193 | + | |
| 5194 | + | |
| 5195 | + | |
| 5196 | + | |
| 5197 | + | |
| 5198 | + | |
| 5199 | + | |
| 5200 | + | |
| 5201 | + | |
| 5202 | + | |
| 5203 | + | |
| 5204 | + | |
| 5205 | + | |
| 5206 | + | |
| 5207 | + | |
| 5208 | + | |
| 5209 | + | |
| 5210 | + | |
| 5211 | + | |
| 5212 | + | |
| 5213 | + | |
| 5214 | + | |
| 5215 | + | |
| 5216 | + | |
| 5217 | + | |
| 5218 | + | |
| 5219 | + | |
| 5220 | + | |
| 5221 | + | |
| 5222 | + | |
| 5223 | + | |
| 5224 | + | |
| 5225 | + | |
| 5226 | + | |
| 5227 | + | |
| 5228 | + | |
| 5229 | + | |
0 commit comments