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
{{ message }}
This repository was archived by the owner on Jan 27, 2026. It is now read-only.
currently, each binary uses a different method for starting up its different components; some do this all in main.rs and others in a command, and the shutdown and task handle stopping is handled differently. the binaries should all have a similar structure for task startup and shutdown.
Proposed Solution
startup:
every binary should have one entrypoint (eg. Worker, Validator) which is the only thing exposed from the library part of the crate. main.rs should then spawn worker.run() for example to start the service. the run() function will consume self and spawn all the different components necessary, run them in a select loop, and handle cancellation signals
shutdown:
run() should only return upon a critical error which the service cannot recover from. otherwise, errors should be logged or handled some other way.
if run() returns, or if a cancellation signal is received, shutdown should be initiated by signaling all spawned tasks and waiting for them to complete in some amount of time (30s). if they don't finish by this time, they can be aborted.