Add hero_proc_sdk::lifecycle module — shared start/stop helpers for all services #66
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Every Hero service that self-registers with hero_proc duplicates ~80 lines of boilerplate:
self_start(): connect to hero_proc, register actions, register service, start service, wait for healthyself_stop(): connect to hero_proc, check status, stop service, wait for haltedwait_for_healthy(): poll service status until "ok" or timeoutwait_for_halted(): poll service status until "halted" or timeoutThis is copy-pasted across hero_embedder, hero_os, hero_inspector, hero_books, hero_voice, hero_redis, hero_aibroker, and others.
Commit
56856efin hero_inspector attempted to usehero_proc_sdk::lifecycle::start_service()/stop_service()— but the module was never created, breaking the build. Fixed in #65 by inlining the pattern, but the shared module should exist.Solution
Add
hero_proc_sdk::lifecyclemodule providing:Then migrate all services to use it.
Repos
Ref: #50 (original plan), #65 (where the inline fix was applied)
Signed-off-by: mik-tf
All 7 services now use
hero_proc_sdk::lifecycle::{start_service, stop_service}for their--start/--stoppaths:.requires(["hero_aibroker_server"])).requires(["hero_inspector_server"]))~895 lines of duplicated registration/polling boilerplate → ~70 lines total. One clean pattern across all services as per issue #50.
Build: 18/18 succeeded, 0 failed, 41 binaries.
Repos touched: hero_aibroker, hero_embedder, hero_inspector (all pushed to development).