https://kotlinlang.org logo
#ktor
Title
# ktor
c

csieflyman

07/19/2021, 9:59 AM
I implement two features A and B. B depends on A. I call environment.monitor.subscribe(ApplicationStopping) to do shutdown task in the feature install function respectively. But the shutdown order is A → B, not B → A because ktor call addLast(registration) in ApplicationEvents.subscribe() Does anyone has workaround?
a

Aleksei Tirman [JB]

07/19/2021, 12:44 PM
Why would you want to rely on an order of notifications?
c

csieflyman

07/19/2021, 12:56 PM
I want to close coroutine channel before server stopped for graceful shutdown. I create channels for different asynchronous task. The last channel I want to close is writing log to database (e.g. login log, request log and error log)
3 Views