Sometimes, it's useful to wait for graceful shutdown to happen before resuming execution on a task.
This can be of particular interest when we don't have anything to do in a Service's run method but want to make sure some cleanup happens on graceful shutdown.
In this scenario, we can achieve this by calling await gracefulShutdown() in run(), followed by whatever cleanup we must do.
Modification
This PR adds a new gracefulShutdown() function to the GracefulShutdown suite.
Result
A new gracefulShutdown() method in the GracefulShutdown suite.
Motivation
Sometimes, it's useful to wait for graceful shutdown to happen before resuming execution on a task.
This can be of particular interest when we don't have anything to do in a Service's
run
method but want to make sure some cleanup happens on graceful shutdown. In this scenario, we can achieve this by callingawait gracefulShutdown()
inrun()
, followed by whatever cleanup we must do.Modification
This PR adds a new
gracefulShutdown()
function to theGracefulShutdown
suite.Result
A new
gracefulShutdown()
method in theGracefulShutdown
suite.