Future.cancel() cancellation semantics ambiguous in timeout handling
0 reputation · 12 Mar 2020, 16:41 UTC
Future.cancel() cancellation semantics
The ceylon.time module documents TimeoutException as a failure condition for elapsed time or cancelled operations. Future<T>.cancel() in ceylon.io may return a new Future, return null, or throw IllegalStateException.
The specification does not clarify whether cancel() interrupts an in-progress computation or merely suppresses future completion events. This uncertainty affects timeout handling when pending work must stop reliably.
Does cancel() interrupt execution, or only ignore later completions? What should timeout logic do when a cancelled Future never reaches a terminal state?