first commit
This commit is contained in:
25
libs/api/shared/infrastructure/README.md
Normal file
25
libs/api/shared/infrastructure/README.md
Normal file
@@ -0,0 +1,25 @@
|
||||
# api-shared-infrastructure
|
||||
|
||||
Event store en PostgreSQL y el camino de los eventos hasta la lectura.
|
||||
|
||||
- **Import**: `@task-stream/api/shared/infrastructure`
|
||||
- **Capa**: `infrastructure` · **Tags**: `scope:api-shared`, `type:infrastructure`
|
||||
|
||||
## Contenido
|
||||
|
||||
- `PostgresEventStore` (tabla `events`, `UNIQUE(stream_id, position)` → `ConcurrencyError`).
|
||||
- `EventSerializer` / `EventDeserializer` y `EventStorePublisher` (sustituye al publisher del `EventBus`: `commit()` persiste).
|
||||
- `EventStoreRelay`: copia los eventos nuevos al Redis Stream (`FOR UPDATE SKIP LOCKED`).
|
||||
- `EventsBridge`: consume el stream y entrega cada evento a sus `@EventsHandler`, en orden y esperando (ACK al final).
|
||||
- Conexiones Redis (`REDIS_CLIENT`, `GRAPHQL_PUB_SUB`) y `SharedInfrastructureModule.forRootAsync`.
|
||||
|
||||
Flujo completo: [Arquitectura](../../../../docs/02-arquitectura.md#22-flujo-completo-de-una-escritura).
|
||||
|
||||
## Comandos
|
||||
|
||||
```sh
|
||||
npx nx lint api-shared-infrastructure
|
||||
npx nx test api-shared-infrastructure # Jest
|
||||
```
|
||||
|
||||
Reglas de dependencia entre capas: [Arquitectura](../../../../docs/02-arquitectura.md#21-capas-hexagonales).
|
||||
Reference in New Issue
Block a user