On application start I am initializing a map containing some client request data.
public void onStart(@Observes StartupEvent ev) {
// initializing a map
}
I would like to extend graceful shutdown functionality: my service should not shutdown until one of the following conditions is met:
- configured period of time has passed (quarkus.shutdown.timeout config property)
- all clients have responded (already supported by Quarkus -> HTTP requests)
- my custom map is empty
How can I subscribe to a shutdown event so I can check during graceful period if my custom map is empty?