Commit 1f9a82e
refactor: extract hook_bus collaborator from webserver_impl
Move the server-wide lifecycle hook state and behaviour out of the
webserver_impl god-object into a cohesive detail::hook_bus collaborator
(the server-scope sibling of detail::resource_hook_table). The bus owns
the eleven per-phase vectors, the shared registration mutex, the advisory
any_hooks_ gate array, and the handler_exception / log_access alias slots;
it exposes add / remove / fire_* / has_hooks_for / phase_hook_count and
takes a per-call error logger so it needs no back-pointer to the server.
webserver_impl now holds one hook_bus by value and keeps thin fire_* /
has_hooks_for / phase_hook_count forwarders (binding log_dispatch_error as
the logger), so every dispatch call site and the webserver_test_access
bridge stay source-compatible. Registration (webserver_add_hook.cpp),
removal (hook_handle.cpp), firing (hook_phase_dispatch.cpp), and the v1
setter aliases (webserver_aliases.cpp) all delegate into the bus.
This is the third of six planned webserver_impl decompositions (after
ip_access_control and ws_registry). No behaviour change: the five
independent mutexes still never nest; the hook mutex is now internal to
the bus. White-box hook tests are re-pointed at impl->hooks_.
Build green; 109/109 tests pass; file-size gate PASS.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent b596fc8 commit 1f9a82e
18 files changed
Lines changed: 1011 additions & 684 deletions
File tree
- src
- detail
- httpserver/detail
- test
- unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
0 commit comments