Is there a way to gracefully shut-down a DOTNET CORE application which is running in DOCKER? If yes, which event I should listen?
All I want is upon cancellation request I would like to pass my cancellation token/s to current methods and postpone the shut-down while they are working.
Looking for a sample code, reference link etc. which are relevant to dotnet core and not generic info
UPDATE This question is not a duplicate of docker container exits immediately even with Console.ReadLine() in a .net core console application because I'm not having an immediate exit issue. I need to tap into event something like Windows.SystemsEvents.SessionEnding and relying on
Console.CancelKeyPress
and/or implementingWebHostBuilder()
doesn't fit the bill.