Is_this_correct_usage_of_structured_concurrency.tx...
# coroutines
o
Is_this_correct_usage_of_structured_concurrency.txt
t
Coroutines launched in the scope of
WorkNodeBase
can be cancelled by explicitely calling
scope.cancel()
. From the documentation of the
cancel()
function, it is stated that the scope is required to have a
Job
to be cancellable. So yes, you have to create a Job instance, otherwise you coroutines will outlive the scope just like with
GlobalScope
.