fabioCollini / CleanWeather

Demo project for SOLID principles in practice: the Clean Architecture
Apache License 2.0
68 stars 13 forks source link

[Question] couroutine question #2

Open tak1111 opened 4 years ago

tak1111 commented 4 years ago

in 'WeatherUseCase', 'OpenWeatherTemperatureRepository'

why use 'coroutineScope'??

What happens if you don't use it

fabioCollini commented 4 years ago

coroutineScope is used to create a nested scope and connect the two calls (so in case of a failure the other one is automatically canceled). It's useful also to manage the exceptions in the right way, you can find more info in this blog post I wrote

kyle8997 commented 4 years ago

thanks.