tcb 0.5.0 → 0.6.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 +4 -4
- data/CHANGELOG.md +40 -1
- data/README.md +290 -133
- data/lib/generators/tcb/domain/domain_generator.rb +1 -1
- data/lib/generators/tcb/event_store/event_store_generator.rb +1 -1
- data/lib/generators/tcb/event_store/templates/migration.rb.tt +11 -7
- data/lib/generators/tcb/install/install_generator.rb +1 -1
- data/lib/generators/tcb/install/templates/tcb.rb.tt +12 -10
- data/lib/tcb/command_bus.rb +5 -1
- data/lib/tcb/configuration.rb +13 -7
- data/lib/tcb/correlation_query.rb +32 -0
- data/lib/tcb/envelope.rb +31 -0
- data/lib/tcb/event_bus/queue_pressure_monitor.rb +35 -0
- data/lib/tcb/event_bus/running_strategy.rb +32 -2
- data/lib/tcb/event_bus/shutdown_strategy.rb +4 -0
- data/lib/tcb/event_bus.rb +40 -38
- data/lib/tcb/event_bus_queue_pressure.rb +10 -0
- data/lib/tcb/event_store/active_record.rb +69 -19
- data/lib/tcb/event_store/in_memory.rb +17 -7
- data/lib/tcb/publish.rb +7 -4
- data/lib/tcb/record.rb +47 -11
- data/lib/tcb/test_helpers/shared.rb +2 -2
- data/lib/tcb/version.rb +1 -1
- data/lib/tcb.rb +44 -11
- metadata +6 -3
- data/lib/tcb/event_store/event_stream_envelope.rb +0 -13
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 77ac348140af6f18f4416932f320bc474f3131c14903c592cf83f352a02e1297
|
|
4
|
+
data.tar.gz: 4f5462a8425eb01612a3e6ffb3b89c8c848504db97d8a2fb913c7961abbc67b2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2eed8f7a67fcef1a356262a854b707964a2d5eb15c910a5a508368fc602e7f0892742e0ff24035a26f7542ae9de14740288db7fe07655d7e13e25a444db8799e
|
|
7
|
+
data.tar.gz: d41fd603ec8b6cc729396ea7ac5b9b692bd983b080f59e8f1df23faab88976563bd460513ed0634d25fba6a3911f77e583e8508c0ce455997347ed25eef00e12
|
data/CHANGELOG.md
CHANGED
|
@@ -5,7 +5,46 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
-
## [
|
|
8
|
+
## [0.6.1] - 2026-05-06
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- Rails generators now invoked with lowercase namespace: `rails g tcb:install`, `rails g tcb:domain`, `rails g tcb:event_store`
|
|
13
|
+
|
|
14
|
+
## [0.6.0] - 2026-04-24
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- `TCB.read_correlation(correlation_id, across: [...])` — cross-domain correlation query; returns all envelopes with the given `correlation_id` across specified domains, ordered by `occurred_at`; `across:` is optional, defaults to all domains with persistence registrations; supports `occurred_after`, `occurred_before`, `between` filters
|
|
19
|
+
- `TCB::CorrelationQuery` — fluent interface for correlation queries with `occurred_after`, `occurred_before`, `between`, `to_a`
|
|
20
|
+
- `TCB::EventStore::InMemory#read_by_correlation` — correlation query support for in-memory store
|
|
21
|
+
- `TCB::EventStore::ActiveRecord#read_by_correlation` — correlation query support via SQL UNION across domain tables
|
|
22
|
+
- `TCB::Envelope` — unified primitive replacing `TCB::EventStore::EventStreamEnvelope`; carries `event`, `event_id`, `stream_id`, `version`, `occurred_at`, `correlation_id`, `causation_id`
|
|
23
|
+
- `TCB::Envelope.wrap(event, correlation_id:, causation_id:)` — factory for wrapping bare events into envelopes with auto-generated `event_id` and `occurred_at`
|
|
24
|
+
- `TCB::Envelope.coerce(event_or_envelope)` — idempotent coercion; returns envelope unchanged, wraps bare events
|
|
25
|
+
- `TCB.dispatch(command, correlation_id:)` — returns `correlation_id` (String); accepts optional override, generates `SecureRandom.uuid` by default
|
|
26
|
+
- `correlation_id` propagation — all envelopes produced within a dispatch share the same `correlation_id`; propagates across thread boundary via envelope data, not execution state
|
|
27
|
+
- `causation_id` propagation — reactive handlers registered via `on / react_with` automatically set `causation_id` to the `event_id` of the triggering envelope; handler interface unchanged (`def call(event)`)
|
|
28
|
+
- `TCB::EventStore::InMemory#append` — accepts `correlation_id:` and `causation_id:`
|
|
29
|
+
- `TCB::EventStore::ActiveRecord#append` — accepts `correlation_id:` and `causation_id:`; persists to DB columns
|
|
30
|
+
- Migration template — adds `correlation_id`, `causation_id` columns with indexes on `event_id` and `correlation_id`
|
|
31
|
+
- `TCB::EventBus.new(sync:)` — synchronous execution mode; handlers execute in caller thread, no dispatcher thread, no polling in tests
|
|
32
|
+
- `TCB::EventBus.new(max_queue_size:, high_water_mark:)` — bounded queue with pressure signalling; emits `TCB::EventBusQueuePressure` on threshold crossing
|
|
33
|
+
- `TCB.configured?` — returns `false` if config does not exist or `event_bus` is not set
|
|
34
|
+
- `TCB.reset!(graceful_shutdown_time:)` — optional graceful bus drain before reset
|
|
35
|
+
- `TCB.domain_modules=` — declare bounded contexts separately from infrastructure configuration
|
|
36
|
+
|
|
37
|
+
### Changed
|
|
38
|
+
|
|
39
|
+
- `TCB.record` — returns envelopes instead of bare events; use `envelopes.map(&:event)` to access domain events
|
|
40
|
+
- `TCB.publish` — accepts envelopes or bare events; bare events wrapped via `Envelope.coerce`
|
|
41
|
+
- `TCB.configure` — configures infrastructure only; domain modules declared separately via `TCB.domain_modules=`
|
|
42
|
+
- `TCB.reset!` — no longer replays configure block; caller responsible for reconfiguring after reset
|
|
43
|
+
|
|
44
|
+
### Removed
|
|
45
|
+
|
|
46
|
+
- `TCB::EventStore::EventStreamEnvelope` — replaced by `TCB::Envelope`
|
|
47
|
+
- `TCB.configure` with `domain_modules:` keyword — replaced by `TCB.domain_modules=` + `TCB.configure`
|
|
9
48
|
|
|
10
49
|
## [0.5.0] - 2026-04-14
|
|
11
50
|
|