Coroutines. How to launch parallel coroutine?

43 views Asked by At

I need to make 3 parallel request. And I need an exception for one request not to block or cancel the execution of another coroutine except for only one type of exception. Here is my code:

 coroutineScope {
            awaitAll(
                async {
                    repository.firstRequest()
                },

                async {
                    repository.secondRequest()
                },

                async { repository.thirdRequest() },
            )
        }

But awaitAll fails immediately as soon as any of the deferreds fail. This is not what I expect.

0

There are 0 answers