shutdown
Shuts down the cluster and its associated components.
This method closes all active services, stops the HTTP server, and closes the underlying client, ensuring a clean and orderly shutdown of the cluster. The shutdown process is encapsulated within a coroutine to handle suspending operations and is wrapped in a try-catch block to log any errors that occur.
Key operations performed during shutdown:
Gracefully closes the
self
session, representing the local node.Iterates through and closes all registered services.
Stops the HTTP server, providing a specific timeout for graceful termination.
Closes the associated client to free up resources.
Logs any exceptions encountered during the shutdown process as warnings, providing details for troubleshooting.