Interface ShutdownController

All Known Implementing Classes:
ExecutorShutdownController, ShutdownController.Wrapper

public interface ShutdownController
The shutdown controller allows registering hooks run on the three shutdown phases:
  • prepare: stop accepting new work (e.g. stop accepting HTTP requests).
  • perform: shut things down, save state if applicable etc.
  • finalize: shutdown the core components like the work thread pool or a database connections.
The shutdown controller also supports running shutdown-preventing actions. Any shutdown request will have to wait until all shutdown preventing actions are done. As soon as a shutdown is on the horizon (initiated or announced), no more shutdown preventing actions will be possible.
  • Method Details

    • onPrepare

      void onPrepare​(io.vavr.CheckedRunnable callback)
    • onPerform

      void onPerform​(io.vavr.CheckedRunnable callback)
    • onFinalize

      void onFinalize​(io.vavr.CheckedRunnable callback)
    • state