spand
10/10/2018, 9:03 AMval scope = GlobalScope + Job()
that is no longer active. If I call scope.launch
the new coroutine will never get a chance to execute but caller of launch
is oblivious to this. Would it not make more sense have a fail fast behaviour akin to Executor.execute
that throws RejectedExecutionException
in a similar situation ?elizarov
10/10/2018, 10:40 AMelizarov
10/10/2018, 10:41 AMelizarov
10/10/2018, 10:41 AMgildor
10/10/2018, 10:42 AMspand
10/10/2018, 10:54 AMConcurrentModificationErrors
and similar fail fast checks are not guaranteed either.spand
10/10/2018, 11:03 AMlaunch
occur outside of the parent as network events come in. Not sure how to change that.elizarov
10/10/2018, 11:04 AMCME
is thrown when you have bug in your code. With a proposed REE
you’ll get it from time to time from a perfectly good code without any bug. That is not Okelizarov
10/10/2018, 11:04 AMspand
10/10/2018, 11:13 AMlaunch
should only happen from inside a parent.spand
10/10/2018, 11:14 AMelizarov
10/10/2018, 11:15 AMelizarov
10/10/2018, 11:15 AMelizarov
10/10/2018, 11:15 AMval resource = openSomeResource()
launch { // child will close resource
try { ... } finally { resource.close }
}
elizarov
10/10/2018, 11:16 AMelizarov
10/10/2018, 11:16 AMlaunch(start = CoroutineStart.ATOMIC)
.spand
10/10/2018, 11:22 AMATOMIC
. I have something similar myself.spand
10/10/2018, 2:09 PMdoSomething()
is either called before create()
, after destroy()
or if the job
is cancelled due to a coding error. Seems like a simple requirement but how would one extend the example to handle that ?elizarov
10/10/2018, 2:11 PMelizarov
10/10/2018, 2:12 PMspand
10/10/2018, 2:21 PMlaunch
isnt synchronously set to isCancelled
)elizarov
10/10/2018, 2:48 PM