https://kotlinlang.org logo
#coroutines
Title
# coroutines
e

elizarov

03/02/2017, 1:46 PM
@kingsley Yes. It is inverted, though. Jobs can have multiple children and when a job completes, all its children are cancelled. So, instead of creating a composite subscription you just launch all the relevant coroutines as children of your job. In some respect every Job is a potential composite (can have an arbitrary number of children). You can read more and find an example in "Children of a coroutine" section of the guide: https://github.com/Kotlin/kotlinx.coroutines/blob/master/coroutines-guide.md
👍 1
k

kingsley

03/02/2017, 5:19 PM
elizarov: Awesome! I just got to see your response now. I'll check out the link. Thank you
2 Views