Commit 3b465db
refactor: stores register cleanup callbacks directly with exit stack
Previously, stores returned clients via `_get_client_for_context()` and the base
class managed them. Now stores directly register their cleanup callbacks with the
exit stack via `_register_cleanup_callbacks(stack)`.
This gives stores more control over their cleanup registration and simplifies
the base class by removing an abstraction layer.
Also updated codegen to map AsyncExitStack -> ExitStack and
enter_async_context -> enter_context for sync code generation.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent ab49e98 commit 3b465db
File tree
21 files changed
+53
-87
lines changed- key-value
- key-value-aio/src/key_value/aio/stores
- disk
- duckdb
- dynamodb
- elasticsearch
- memcached
- mongodb
- redis
- rocksdb
- valkey
- key-value-sync/src/key_value/sync/code_gen/stores
- disk
- duckdb
- elasticsearch
- mongodb
- redis
- rocksdb
- valkey
- scripts
21 files changed
+53
-87
lines changedLines changed: 17 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
434 | 434 | | |
435 | 435 | | |
436 | 436 | | |
437 | | - | |
438 | | - | |
439 | | - | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
440 | 440 | | |
441 | 441 | | |
442 | 442 | | |
443 | 443 | | |
444 | | - | |
445 | 444 | | |
446 | 445 | | |
447 | 446 | | |
| |||
454 | 453 | | |
455 | 454 | | |
456 | 455 | | |
457 | | - | |
458 | 456 | | |
459 | 457 | | |
460 | | - | |
461 | | - | |
| 458 | + | |
| 459 | + | |
462 | 460 | | |
463 | | - | |
464 | | - | |
465 | | - | |
| 461 | + | |
| 462 | + | |
466 | 463 | | |
467 | | - | |
468 | | - | |
469 | | - | |
470 | | - | |
471 | | - | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
472 | 467 | | |
473 | | - | |
474 | | - | |
| 468 | + | |
| 469 | + | |
475 | 470 | | |
476 | | - | |
477 | | - | |
| 471 | + | |
| 472 | + | |
478 | 473 | | |
479 | | - | |
480 | 474 | | |
481 | 475 | | |
482 | | - | |
| 476 | + | |
483 | 477 | | |
484 | 478 | | |
485 | 479 | | |
| |||
490 | 484 | | |
491 | 485 | | |
492 | 486 | | |
493 | | - | |
| 487 | + | |
494 | 488 | | |
495 | | - | |
496 | | - | |
497 | | - | |
498 | | - | |
| 489 | + | |
499 | 490 | | |
500 | 491 | | |
501 | 492 | | |
| |||
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
151 | | - | |
152 | 151 | | |
153 | 152 | | |
154 | 153 | | |
| |||
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | | - | |
130 | 129 | | |
131 | 130 | | |
132 | 131 | | |
| |||
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
362 | 362 | | |
363 | 363 | | |
364 | 364 | | |
365 | | - | |
366 | 365 | | |
367 | 366 | | |
368 | 367 | | |
| |||
Lines changed: 5 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
123 | 124 | | |
124 | 125 | | |
125 | 126 | | |
126 | | - | |
127 | | - | |
128 | | - | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
129 | 131 | | |
130 | 132 | | |
131 | 133 | | |
| |||
137 | 139 | | |
138 | 140 | | |
139 | 141 | | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | 142 | | |
148 | 143 | | |
149 | 144 | | |
| |||
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
552 | 552 | | |
553 | 553 | | |
554 | 554 | | |
555 | | - | |
556 | 555 | | |
557 | 556 | | |
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
155 | | - | |
156 | 155 | | |
157 | 156 | | |
Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
193 | 194 | | |
194 | 195 | | |
195 | 196 | | |
196 | | - | |
197 | | - | |
198 | | - | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
199 | 200 | | |
200 | 201 | | |
201 | 202 | | |
| |||
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
225 | | - | |
226 | 225 | | |
227 | 226 | | |
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
89 | 88 | | |
90 | 89 | | |
91 | 90 | | |
| |||
0 commit comments