remove Supervisor jobs, allow exceptions to stop the whole application

This commit is contained in:
Adam 2022-05-14 12:55:33 +02:00
parent 7c77083c89
commit 775fd4c5b3
2 changed files with 2 additions and 2 deletions

View file

@ -32,7 +32,7 @@ internal class KafkatorioTopology(
) : CoroutineScope {
override val coroutineContext: CoroutineContext =
Dispatchers.Default + SupervisorJob(rootJob) + CoroutineName("KafkatorioTopology")
Dispatchers.Default + rootJob + CoroutineName("KafkatorioTopology")
fun start() {
splitPackets()

View file

@ -21,7 +21,7 @@ import org.http4k.websocket.WsStatus
class WebsocketServer {
// create a scope+job for the server
private val serverJob = SupervisorJob()
private val serverJob = KafkatorioTopology.rootJob
private val serverScope = CoroutineScope(serverJob)
private val clients: MutableSharedFlow<Websocket> = MutableSharedFlow(