You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(wordpress): fold process discovery into register_hooks (0.2.2) (#12)
boot() now truly is the whole ceremony: register_hooks() reads the
ddd.long_process container tag (guarded by findTaggedServiceIds, same
style as the handler sweep) and registers every tagged LongProcess —
plus resume hooks for its #[Awaits] events — with the ProcessRunner.
Previously discovery was a separate manual call consumers had to
remember: datastream made it, cred declared a privately-named tag
(tgbl.long_process) that nothing ever scanned. The scaffolder now emits
the _instanceof rule so fresh consumers are saga-ready, and the wiring
guide documents the tag-name and manual-call anti-patterns.
Double registration stays safe: ProcessRunner::register_event is
idempotent per event class on the shared runner instance.
Co-authored-by: Titus TC <titus@teamtangible.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/wiring-a-consumer.md
+23Lines changed: 23 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -198,15 +198,38 @@ regardless of which features it uses today:
198
198
| `register_event_handlers` | async handlers + `IntegrationListener`s never `add_action` (Symfony DI is lazy) — AS fails with "no callbacks registered" |
199
199
| `register_outbox_hooks` | **outbox never drains** — integration events written, never delivered (this exact bug shipped twice) |
200
200
| `register_process_hooks` | sagas never resume after the AS hop |
201
+
| process discovery | saga classes never registered with the `ProcessRunner` — awaited integration events fire but wake nothing (see below) |
201
202
| `register_migration_hooks` | framework schema migrations never run — fresh installs never get their tables (the lane runs on `init` + `admin_init`; it replaces the activation hook entirely), upgraded installs drift |
202
203
204
+
**Process discovery** (0.2.2): `register_hooks()` reads the
205
+
`ddd.long_process`container tag and registers every tagged class — plus
206
+
the resume hooks for its `#[Awaits(Event::class)]` events — with the
207
+
`ProcessRunner`. The consumer's only job is the `_instanceof` rule the
208
+
scaffolder already emits:
209
+
210
+
```yaml
211
+
_instanceof:
212
+
TangibleDDD\Application\Process\LongProcess:
213
+
tags: ['ddd.long_process']
214
+
```
215
+
216
+
Discovery needs `findTaggedServiceIds()` (a `ContainerBuilder` API) — with a
217
+
dumped/opaque container it is skipped silently, same guard as the handler
218
+
sweep. Declare awaited events with the `#[Awaits]` class attribute, not tag
0 commit comments