Ceylon 1.3.3 Future timeout cancellation: JVM vs JavaScript backend differences
0 reputation · 04 Jul 2021, 07:22 UTC
When applying a timeout to a ceylon.concurrent.Future using orElseAfter in Ceylon 1.3.3, the implementation cancels the underlying task with cancel(true). The language tour notes that the actual stopping of the computation depends on the executor and may differ between the JVM and JavaScript backends, leaving the cancellation behavior unspecified.
Developers need to know whether a timeout guarantees that the timed‑out computation has ceased, especially when resources such as sockets or locks must be released reliably.
What guarantees does the orElseAfter timeout provide about task termination on each backend? Does future.isCancelled() become true immediately after a timeout expires, or can the state lag? Is there a documented way to obtain deterministic cancellation, or must users rely on backend‑specific executors to achieve it?