abbic
02/20/2023, 6:59 PMabbic
02/20/2023, 7:01 PMfactory { SupervisiorJob() }
single { CoroutineScope(<http://Dispatchers.IO|Dispatchers.IO> + get<SupervisorJob>()) }
do the trick for me?abbic
02/20/2023, 7:01 PMsingle { CoroutineScope(<http://Dispatchers.IO|Dispatchers.IO> + SupervisorJob()) }
Pedro Alberto
02/21/2023, 9:25 AMPedro Alberto
02/21/2023, 9:26 AMPedro Alberto
02/21/2023, 9:28 AMfactoryOf(::MainScope)
class MainScope: CoroutineScope {
val supervisorJob: CompletableJob = SupervisorJob()
override val coroutineContext: CoroutineContext
get() = supervisorJob + Dispatchers.MAIN
}
Pedro Alberto
02/21/2023, 9:30 AMPedro Alberto
02/21/2023, 9:30 AMarnaud.giuliani
02/21/2023, 4:20 PMarnaud.giuliani
02/21/2023, 4:21 PMarnaud.giuliani
02/21/2023, 4:22 PMPedro Alberto
02/22/2023, 8:12 AMarnaud.giuliani
02/22/2023, 9:01 AMarnaud.giuliani
02/22/2023, 9:01 AMabbic
02/22/2023, 1:34 PMPedro Alberto
02/22/2023, 2:47 PMfactory {
MainScope()
}
The thing why we went this way is that don't need to define every time where use the CoroutineScope. It becomes easier to use but if there is any side effect I would like to know.arnaud.giuliani
02/23/2023, 9:30 AMPedro Alberto
02/23/2023, 10:47 AMPedro Alberto
02/23/2023, 10:47 AMarnaud.giuliani
02/23/2023, 2:55 PM