Interface ServerShutDownDelayer


  • public interface ServerShutDownDelayer
    An interface which can be implemented and provided to delay shutdown of the server. Health check will become unhealthy when the server receives a termination signal but the server will not begin shutdown until all ServerShutDownDelayers have indicated they are ready.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      com.google.common.util.concurrent.ListenableFuture<java.lang.Void> readyForShutdown()
      Returns a future which must be completed to indicate the server will be shutdown.
    • Method Detail

      • readyForShutdown

        com.google.common.util.concurrent.ListenableFuture<java.lang.Void> readyForShutdown()
        Returns a future which must be completed to indicate the server will be shutdown. This method will be called when the server receives a shutdown signal. The server will actually begin to shutdown when all ServerShutDownDelayer have completed their returned future. Implementations should only complete the future successfully - exceptional completion will still trigger shutdown but will not be handled or logged in anyway.

        There is no timeout on completion of this future - it is recommended an external timeout, such as a Kubernetes shutdown delay, is used to ensure the server isn't stuck forever.