Nit (Motivation section):
and instead needs only on high-level semantic properties
“needs only high-level…” or “relies only on high-level…”, I assume
UnownedJobRef
:
The executor reference must remain valid during this call unless it is a serial executor which the job successfully gives up.
This is unclear to me. Does it mean that if execute(currentExecutor: someRef)
in turn causes some switching or suspending activity, someRef
can then become invalid before this invocation of execute
returns?
Also, would it not make sense to have a version of Task.runDetached
that takes an executor? Or should we assume that Task.runDetached { someExecutor.run { … }}
will avoid bouncing off the default concurrent scheduler?