Given we have job1 : Job and job2 : Job and we want to make job2 a child of job1 (they where created separately have no relation).
What is the correct way to declare that relationship? so that when job1 is cancelled job2 is cancelled as well...
I tried job1.attachChild(e1.job2 as ChildJob) but this is internal api.
I do not want to do some hack when i launch job2 from job1 coroutine.
Simply launch job2 from inside the scope of job1. Job2 will inherit the scope, and so if job1 is cancelled then so is job2.