tunnelvisionlabs/java-threading

JRE behavior of thenCompose changed during an update

Closed this issue · 0 comments

In the original release of Java 8, if the antecedent function passed to thenCompose was already completed then a cancelled continuation would properly result in the combined asynchronous operation completing in the cancelled state. This behavior was leveraged by Async.awaitAsync to avoid a costly call to Futures.unwrap, with the primary benefiting scenario being cases where an asynchronous interface method was able to be implemented synchronously. (This is the same case that led C# 7 to optimize the other direction with the creation of ValueTask<T>.)