netty5/common
Chris Vest 445f747ce3
Add a Futures class with static map() and flatMap() methods (#11607)
Motivation:
Making futures easier to compose, combine, and extend is useful to have as part of the API, since implementing this correctly and efficiently can be tricky.

Modification:
Add `Future.map(Function<V,R>) -> Future<R>` and `Future.flatMap(Function<V,Future<R>>) -> Future<R>` default methods to the `Future` interface.
These methods return new Future instance, that will be completed when the original future completes, and the result will be processed through the given mapping function.
These two methods take care to propagate cancellation and exceptions correctly:
Cancellation propagates both ways between the new and original future.
Failures only propagate from the original future to the returned new Future instance.

Result:
A few convenient methods for modifying and composing futures.

This PR fixes #8523, and perhaps also #2105
2021-08-26 11:23:12 +02:00
..
src Add a Futures class with static map() and flatMap() methods (#11607) 2021-08-26 11:23:12 +02:00
pom.xml Update graal annotations dependencies GAV to allow license GPL2+CE (#11404) 2021-06-21 16:11:57 +02:00