Is there a way to shutdown the cats effect runtime from within an application, similar to System.exit(0)
?
There is a shutdown
method on IORuntime
but it is not documented and it behaves weirdly when I call it on IORuntime.global
: it does not shut the application down, it just seems to hang it. Also accessing runtime
on my IOApp
just throws a NullPointerException
so I cannot use that. What I want to do is: from within my application a want to make the complete runtime shutdown cleanly, i.e. cancelling the main fiber and running all finalisers. I know I can implement such a shutdown-hook myself, but I was wondering if that is already supported somehow by cats effect, which is what the existence of these methods suggest.