- Application components systems can continue to use ApplicationLifecycle
- Can now also use CoordinatedShutdown if want richer API
- Suggest that we don't change ApplicationLifecycle API to expose phases (yet)
- Application can now create its own ApplicationLifecycle from the ActorSystem
- Calls ApplicationLifecycle.stop() during a phase of CS
- ApplicationLifecycle manages ordering (as suggested by Patrik)
- Ensures that ActorSystem is created before anything other resources since they would depend on ApplicationLifecycle
- Deprecate/remove ApplicationLifecycle from the ApplicationLoader.Context object
- Server can now use the Application's ActorSystem's CS if they need to hook into Application shutdown
- Calls ApplicationLifecycle.stop() during a phase of CS
- Change Application.stop() to call CoordinatedShutdown.run()
- Maybe deprecate this method; remove it or replace it with something returning a Future
- need to keep Server/Application ActorSystem split in Dev mode since we don't have an alternative
- In Prod/Test mode, the Server shares the ActorSystem with the Application - much simpler
- server doesn't know which it is using for itself, just uses ActorSystem in ServerProvider.Context
- server can register 'server/HTTP stack' stuff on the ActorSystem in ServerProvider.Context
- server can register 'application' stuff on the ActorSystem in its Application's actorSystem
- Server now initiates Application shutdowns on reload by calling CS
- Server needs to listen for Application-initiated shutdown and stop itself (new behaviour)
- Suggest we don't worry too much for now about making phases work well across the two ActorSystems
- e.g. timing Application shutdown vs socket close might be a bit random
- can fix later if we want/care
- AkkaHttpServer will shut down correctly since its HTTP stack is managed by the ActorSystem
- NettyServer will need to explicitly hook into CS
- not sure if I understand the issues here?
- Currently use a custom Configuration.load implementation which adds a new type of configuration file (reference-overrides.conf) — confusing!
- Remove this and just write explicit configuration into ActorSystemProvider (we already do this for some stuff so it's a simplification)
- think about Akka's exit-on-fatal-exception behaviour - not great in dev mode