View Code? Open in Web Editor
NEW
🦝 Java CompletableFuture Fu(aka CF-Fu, pronounced "Shifu"), a tiny sidekick library to improve user experience and reduce misuse.
Home Page: https://github.com/foldright/cffu
License: Apache License 2.0
Java 69.93%
Kotlin 28.98%
Shell 1.09%
cffu's Issues
📚 Documentation
🦮 CompletableFuture
Guide
see README.md
🎪 CompletableFuture
Usage Showcase
see CompletableFutureUsageShowcaseTest.kt
🇨🇳 Translations
📦 Library
see
✨ Support the missing convenient new functions
🚗 Customizable CF
🔮 backport CF
functions from high java versions to Java 8
🍩 Kotlin
support
🙌 Mics
☔️ Testing
👷 Chore
目前CompletableFuture
提供的都是最多两个入参的方法。
CompletableFuture <Map > future1 = CompletableFuture .supplyAsync (() -> {
Map result = Maps .newHashMap ();
result .put ("j" , "j" );
return result ;
});
future1 .thenAccept ((Map map ) -> {
System .out .println ("thenAccept:" + map .get ("j" ));
});
future1 .thenCombine (CompletableFuture .completedFuture ("123" ), (map , s ) -> {
System .out .println ("thenCombine:" + map .get ("j" ));
System .out .println (s );
return "yy" ;
});
能否提供操作多个入参的工具类方法?
例如多个入参的消费accept
/combine
。
Frist thanks for sharing, some suggestions below:
Provides an extension definition for Kotlin ?
Provides an extension for Vertx Function?
How about keep the Cffu a clean room, and not extends the Future
and CompletionStage
directly, but provides methods like fromCompletionStage
and toCompletionStage
.
then we can have method like failed
instead of failedStage
.