Hello everyone! If I subscribe to the environment ...
# ktor
n
Hello everyone! If I subscribe to the environment monitor like
environment.monitor.subscribe(ApplicationStarted)
every time hot-reload happens it will subscribe one more function subscribed call. is this behaviour normal?
example
Copy code
environment.monitor.subscribe(ApplicationStarted) {
        print("hi")
    }
outputs first load
hi15:30:45.022 [main] TRACE ktor.application - Application started: io.ktor.application.Application@1ad926d3
second load (hot-reload)
hihi16:24:00.587 [nioEventLoopGroup-3-1] TRACE ktor.application - Application started: io.ktor.application.Application@353d7adb
s
out of curiosity, is ApplicationStopped also called?
n
hihi19:59:50.527 [nioEventLoopGroup-3-1] TRACE ktor.application - Application stopped: io.ktor.application.Application@244b9b58
it is called
environment.monitor
is the same instance between restarts
s
It looks like it is working as designed then. I would expect a sane app server to restart if I reload a random class.