@ddd-ts-kit/redis 0.113.2 → 0.114.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.
package/README.fr.md CHANGED
@@ -1,5 +1,5 @@
1
1
  [English](README.md) · **Français**
2
- <!-- translation-of: README.md sha256:d22af54bf265554f -->
2
+ <!-- translation-of: README.md sha256:9e02c42e5ab46747 -->
3
3
 
4
4
  # @ddd-ts-kit/redis
5
5
 
@@ -26,7 +26,7 @@ Rien ici n'est importé depuis `domain/` ou `application/`. Un cas d'usage dépe
26
26
  (`Cache`, `Lock`, `RateLimiter` du noyau) ; l'adaptateur est choisi dans `platform/` et lié dans
27
27
  la racine de composition.
28
28
 
29
- ![Les six ports que le code nomme (Cache, Lock, RateLimiter, RelaySignal, JobStore, EventBus), les six adaptateurs de @ddd-ts-kit/redis qui les implémentent, et l'unique serveur auquel ils envoient leurs commandes ; la plateforme les lie, l'outbox et les événements traités restent dans la base de données](https://raw.githubusercontent.com/gbourgeat/ddd-ts-kit/main/docs/assets/diagrams/redis-place-in-an-application.fr.svg)
29
+ ![Les six ports que le code nomme (Cache, Lock, RateLimiter, RelaySignal, JobStore, EventBus), les six adaptateurs de @ddd-ts-kit/redis qui les implémentent, et l'unique serveur auquel ils envoient leurs commandes ; la plateforme les lie, l'outbox et les événements traités restent dans la base de données](https://raw.githubusercontent.com/ddd-ts-kit/ddd-ts-kit/main/docs/assets/diagrams/redis-place-in-an-application.fr.svg)
30
30
 
31
31
  Le même cas d'usage tourne alors contre Redis en production et contre les adaptateurs en mémoire
32
32
  du noyau dans ses tests. Au lieu de nommer l'adaptateur, ce qui lie le cas d'usage à un seul
@@ -431,7 +431,7 @@ qui le précèdent. Un appel refusé n'est pas compté. `RedisRateLimiter` garde
431
431
  (sorted set) par clé, un membre par appel autorisé, et décide dans un seul script, si bien que des
432
432
  appels concurrents venus de plusieurs instances ne peuvent pas prendre tous deux la dernière place.
433
433
 
434
- ![Une limite de trois appels par minute : les appels à 20, 30 et 45 secondes sont autorisés ; l'appel à 60 secondes voit trois appels dans sa fenêtre, il est refusé, non compté, et invité à réessayer dans 20 secondes ; l'appel à 82 secondes en voit deux et il est autorisé](https://raw.githubusercontent.com/gbourgeat/ddd-ts-kit/main/docs/assets/diagrams/redis-rate-limiter-sliding-window.fr.svg)
434
+ ![Une limite de trois appels par minute : les appels à 20, 30 et 45 secondes sont autorisés ; l'appel à 60 secondes voit trois appels dans sa fenêtre, il est refusé, non compté, et invité à réessayer dans 20 secondes ; l'appel à 82 secondes en voit deux et il est autorisé](https://raw.githubusercontent.com/ddd-ts-kit/ddd-ts-kit/main/docs/assets/diagrams/redis-rate-limiter-sliding-window.fr.svg)
435
435
 
436
436
  `remaining` compte les places qui restent une fois cet appel compté ; `retryAfterMs` vaut 0 pour
437
437
  un appel autorisé et, pour un appel refusé, le temps qui reste avant que l'appel le plus ancien de
@@ -600,7 +600,7 @@ configuré, et la rétention est bornée par la mémoire : voir
600
600
  Les gestionnaires ne voient jamais ce *package*. Ils publient dans l'outbox ; le relais publie
601
601
  dans les flux ; chaque contexte consommateur s'abonne par le bus, sous son propre nom.
602
602
 
603
- ![Le relais de l'outbox prend les enregistrements en attente dans la table de l'outbox et les publie avec XADD dans un seul MULTI ; chaque type d'événement a un flux ; chaque nom de consommateur y a son propre groupe, notifications et billing, qui reçoivent tous deux chaque événement ; les instances de billing se partagent ses entrées ; une entrée en échec ou empoisonnée va dans le flux de rejet de billing](https://raw.githubusercontent.com/gbourgeat/ddd-ts-kit/main/docs/assets/diagrams/redis-streams-topology.fr.svg)
603
+ ![Le relais de l'outbox prend les enregistrements en attente dans la table de l'outbox et les publie avec XADD dans un seul MULTI ; chaque type d'événement a un flux ; chaque nom de consommateur y a son propre groupe, notifications et billing, qui reçoivent tous deux chaque événement ; les instances de billing se partagent ses entrées ; une entrée en échec ou empoisonnée va dans le flux de rejet de billing](https://raw.githubusercontent.com/ddd-ts-kit/ddd-ts-kit/main/docs/assets/diagrams/redis-streams-topology.fr.svg)
604
604
 
605
605
  <!-- checked sample -->
606
606
  ```ts
@@ -761,7 +761,7 @@ compte.
761
761
 
762
762
  ### Comportement des nouvelles tentatives et de la file de rejet
763
763
 
764
- ![Une entrée livrée avec la tentative n : sans enveloppe, elle va dans le flux de rejet comme entrée empoisonnée ; au-delà de retry.maxAttempts, après que ses instances ont planté sur elle, dans le flux de rejet comme ATTEMPTS_EXHAUSTED ; sinon chaque gestionnaire de son type s'exécute ; s'ils se sont tous résolus, elle est acquittée ; si l'un a levé une exception à la dernière tentative, elle est copiée dans le flux de rejet et acquittée en un seul script ; sinon elle reste en attente et elle est reprise après retry.delayMs ; une autre instance reprend les entrées d'une instance plantée après visibilityTimeoutMs](https://raw.githubusercontent.com/gbourgeat/ddd-ts-kit/main/docs/assets/diagrams/redis-streams-retry-and-dead-letter.fr.svg)
764
+ ![Une entrée livrée avec la tentative n : sans enveloppe, elle va dans le flux de rejet comme entrée empoisonnée ; au-delà de retry.maxAttempts, après que ses instances ont planté sur elle, dans le flux de rejet comme ATTEMPTS_EXHAUSTED ; sinon chaque gestionnaire de son type s'exécute ; s'ils se sont tous résolus, elle est acquittée ; si l'un a levé une exception à la dernière tentative, elle est copiée dans le flux de rejet et acquittée en un seul script ; sinon elle reste en attente et elle est reprise après retry.delayMs ; une autre instance reprend les entrées d'une instance plantée après visibilityTimeoutMs](https://raw.githubusercontent.com/ddd-ts-kit/ddd-ts-kit/main/docs/assets/diagrams/redis-streams-retry-and-dead-letter.fr.svg)
765
765
 
766
766
  1. Une entrée est acquittée (`XACK`) après que chaque gestionnaire abonné à son type s'est résolu.
767
767
  Utilisez `consume` de `@ddd-ts-kit/events` : l'acquittement suit alors la validation (commit)
package/README.md CHANGED
@@ -25,7 +25,7 @@ Nothing here is imported from `domain/` or `application/`. A use case depends on
25
25
  (`Cache`, `Lock`, `RateLimiter` of the kernel); the adapter is chosen in `platform/` and bound
26
26
  in the composition root.
27
27
 
28
- ![The six ports the code names (Cache, Lock, RateLimiter, RelaySignal, JobStore, EventBus), the six adapters of @ddd-ts-kit/redis that implement them, and the one server they send their commands to; the platform binds them, the outbox and the processed events stay in the database](https://raw.githubusercontent.com/gbourgeat/ddd-ts-kit/main/docs/assets/diagrams/redis-place-in-an-application.svg)
28
+ ![The six ports the code names (Cache, Lock, RateLimiter, RelaySignal, JobStore, EventBus), the six adapters of @ddd-ts-kit/redis that implement them, and the one server they send their commands to; the platform binds them, the outbox and the processed events stay in the database](https://raw.githubusercontent.com/ddd-ts-kit/ddd-ts-kit/main/docs/assets/diagrams/redis-place-in-an-application.svg)
29
29
 
30
30
  The same use case then runs against Redis in production and against the in-memory adapters of
31
31
  the kernel in its tests. Instead of naming the adapter, which ties the use case to one server
@@ -420,7 +420,7 @@ it. A refused call is not counted. `RedisRateLimiter` keeps one sorted set per k
420
420
  per allowed call, and decides in a single script, so concurrent calls from several instances
421
421
  cannot both take the last place.
422
422
 
423
- ![A limit of three calls per minute: the calls at 20, 30 and 45 seconds are allowed; the call at 60 seconds sees three calls in its window, is refused, not counted, and told to retry after 20 seconds; the call at 82 seconds sees two and is allowed](https://raw.githubusercontent.com/gbourgeat/ddd-ts-kit/main/docs/assets/diagrams/redis-rate-limiter-sliding-window.svg)
423
+ ![A limit of three calls per minute: the calls at 20, 30 and 45 seconds are allowed; the call at 60 seconds sees three calls in its window, is refused, not counted, and told to retry after 20 seconds; the call at 82 seconds sees two and is allowed](https://raw.githubusercontent.com/ddd-ts-kit/ddd-ts-kit/main/docs/assets/diagrams/redis-rate-limiter-sliding-window.svg)
424
424
 
425
425
  `remaining` counts the places left once this call is counted; `retryAfterMs` is 0 for an
426
426
  allowed call, and for a refused one the time until the oldest call of the window leaves it.
@@ -582,7 +582,7 @@ memory: see [Guarantees and limits](#guarantees-and-limits).
582
582
  Handlers never see this package. They publish to the outbox; the relay publishes to the
583
583
  streams; each consuming context subscribes through the bus under its own name.
584
584
 
585
- ![The outbox relay claims pending records from the outbox table and publishes them with XADD in one MULTI; each event type has one stream; each consumer name has its own group on it, notifications and billing, both receiving every event; the instances of billing share its entries; a failed or poison entry goes to the dead stream of billing](https://raw.githubusercontent.com/gbourgeat/ddd-ts-kit/main/docs/assets/diagrams/redis-streams-topology.svg)
585
+ ![The outbox relay claims pending records from the outbox table and publishes them with XADD in one MULTI; each event type has one stream; each consumer name has its own group on it, notifications and billing, both receiving every event; the instances of billing share its entries; a failed or poison entry goes to the dead stream of billing](https://raw.githubusercontent.com/ddd-ts-kit/ddd-ts-kit/main/docs/assets/diagrams/redis-streams-topology.svg)
586
586
 
587
587
  <!-- checked sample -->
588
588
  ```ts
@@ -740,7 +740,7 @@ version in the payload when it matters.
740
740
 
741
741
  ### Retry and dead-letter behaviour
742
742
 
743
- ![An entry delivered with attempt n: without an envelope it goes to the dead stream as poison; past retry.maxAttempts after its instances crashed on it, to the dead stream as ATTEMPTS_EXHAUSTED; otherwise every handler of its type runs; all resolved, it is acknowledged; one threw on the last attempt, it is copied to the dead stream and acknowledged in one script; otherwise it stays pending and is claimed again after retry.delayMs; another instance takes over the entries of a crashed one after visibilityTimeoutMs](https://raw.githubusercontent.com/gbourgeat/ddd-ts-kit/main/docs/assets/diagrams/redis-streams-retry-and-dead-letter.svg)
743
+ ![An entry delivered with attempt n: without an envelope it goes to the dead stream as poison; past retry.maxAttempts after its instances crashed on it, to the dead stream as ATTEMPTS_EXHAUSTED; otherwise every handler of its type runs; all resolved, it is acknowledged; one threw on the last attempt, it is copied to the dead stream and acknowledged in one script; otherwise it stays pending and is claimed again after retry.delayMs; another instance takes over the entries of a crashed one after visibilityTimeoutMs](https://raw.githubusercontent.com/ddd-ts-kit/ddd-ts-kit/main/docs/assets/diagrams/redis-streams-retry-and-dead-letter.svg)
744
744
 
745
745
  1. An entry is acknowledged (`XACK`) after every handler subscribed to its type resolved. Use
746
746
  `consume` of `@ddd-ts-kit/events`: the acknowledgement then follows the commit of the unit
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ddd-ts-kit/redis",
3
- "version": "0.113.2",
3
+ "version": "0.114.1",
4
4
  "description": "Adapters of the kernel ports on the Redis protocol (Redis, Dragonfly, Valkey): cache, distributed lock, rate limiter, relay wake-up signal, a background job store, and an integration event provider on Redis Streams.",
5
5
  "keywords": [
6
6
  "ddd",
@@ -19,11 +19,11 @@
19
19
  "license": "MIT",
20
20
  "repository": {
21
21
  "type": "git",
22
- "url": "git+https://github.com/gbourgeat/ddd-ts-kit.git",
22
+ "url": "git+https://github.com/ddd-ts-kit/ddd-ts-kit.git",
23
23
  "directory": "packages/redis"
24
24
  },
25
- "homepage": "https://gbourgeat.github.io/ddd-ts-kit/packages/redis/",
26
- "bugs": "https://github.com/gbourgeat/ddd-ts-kit/issues",
25
+ "homepage": "https://ddd-ts-kit.github.io/ddd-ts-kit/packages/redis/",
26
+ "bugs": "https://github.com/ddd-ts-kit/ddd-ts-kit/issues",
27
27
  "publishConfig": {
28
28
  "access": "public",
29
29
  "provenance": true
@@ -51,12 +51,12 @@
51
51
  "dist"
52
52
  ],
53
53
  "dependencies": {
54
- "@ddd-ts-kit/kernel": "0.113.2",
55
- "@ddd-ts-kit/scheduling": "0.113.2"
54
+ "@ddd-ts-kit/kernel": "0.114.1",
55
+ "@ddd-ts-kit/scheduling": "0.114.1"
56
56
  },
57
57
  "peerDependencies": {
58
58
  "ioredis": "^5.0.0 || ^6.0.0",
59
- "@ddd-ts-kit/testing": "0.113.2"
59
+ "@ddd-ts-kit/testing": "0.114.1"
60
60
  },
61
61
  "peerDependenciesMeta": {
62
62
  "@ddd-ts-kit/testing": {
@@ -65,8 +65,8 @@
65
65
  },
66
66
  "devDependencies": {
67
67
  "ioredis": "^6.0.0",
68
- "@ddd-ts-kit/events": "0.113.2",
69
- "@ddd-ts-kit/testing": "0.113.2",
68
+ "@ddd-ts-kit/events": "0.114.1",
69
+ "@ddd-ts-kit/testing": "0.114.1",
70
70
  "wasmoon-lua5.1": "1.18.12"
71
71
  }
72
72
  }