IsaacMart
11/21/2022, 8:57 AMrobert
11/21/2022, 9:02 AMIsaacMart
11/21/2022, 9:10 AMrobert
11/21/2022, 9:15 AMJobScheduler
built in - I would look at that and not Kotlin/ktor aspectsIsaacMart
11/21/2022, 9:21 AMrobert
11/21/2022, 9:24 AMIsaacMart
11/21/2022, 9:27 AMrobert
11/21/2022, 9:31 AMYou are MUCH better off dropping an entry into a DB and polling it for any that are due and run the code off of that
Oliver.O
11/21/2022, 9:32 AMrobert
11/21/2022, 9:35 AMrobert
11/21/2022, 9:39 AMOliver.O
11/21/2022, 9:42 AMfun runApplicationServer() {
embeddedServer(
Netty,
port = 8080,
host = "0.0.0.0",
module = Application::backendModule
).start(wait = true)
}
fun Application.backendModule() {
val expirationJob = launch {
delay(20.minutes)
// do something
}
install(ContentNegotiation)
// ...
routing {
// ...
// Use expirationJob.cancel() to stop a running job and/or restart a new job as required
}
}
IsaacMart
11/21/2022, 9:47 AMrobert
11/21/2022, 9:49 AMsuch complexity can be avoidedI think polling a DB is infinitely less complex that trying to get 100% uptime on a single piece of silicon
robert
11/21/2022, 9:50 AMOliver.O
11/21/2022, 9:52 AMIsaacMart
11/21/2022, 10:04 AMColton Idle
11/21/2022, 2:16 PMAlexander Weickmann
11/23/2022, 5:02 PMrobert
11/24/2022, 6:33 AMIsaacMart
11/24/2022, 6:47 AM