Background tasks in Ktor like "Hosted Service" in ASP.Net Core

1.3k Views Asked by At

I'd like to know how to create a background tasks in Ktor like "Hosted Service" in ASP.Net Core. I need to have a background task running indefinitly on my Ktor server.

I'm coming from a C# background and we handle this with "Hosted services" in c# asp.net core

Any suggestions, samples

Than you very much. best regards

1

There are 1 best solutions below

0
On

There is no functionality for background tasks in Ktor but you can use background jobs from the kotlinx.coroutines library.