SkillAgentSearch skills...

Cffu

๐Ÿฆ Java CompletableFuture-Fu ("CF-Fu", pronounced "Shifu") is a tiny library that improves the CompletableFuture (CF) usage experience and reduces misuse, enabling more convenient, efficient, and safe use of CF in your application. ๐Ÿ˜‹๐Ÿš€๐Ÿฆบ

Install / Use

/learn @foldright/Cffu

README

<div align="center"><a href="#dummy"><img src="https://github.com/foldright/cffu/assets/1063891/124658cd-025f-471e-8da1-7eea0e482915" alt="๐Ÿฆ CompletableFuture-Fu(CF-Fu)"></a></div>

<p align="center"> <a href="https://github.com/foldright/cffu/actions/workflows/fast_ci.yaml"><img src="https://img.shields.io/github/actions/workflow/status/foldright/cffu/fast_ci.yaml?branch=2.x-dev&logo=github&logoColor=white&label=fast%20ci" alt="Fast Build CI"></a> <a href="https://github.com/foldright/cffu/actions/workflows/ci.yaml"><img src="https://img.shields.io/github/actions/workflow/status/foldright/cffu/ci.yaml?branch=2.x-dev&logo=github&logoColor=white&label=strong%20ci" alt="Strong Build CI"></a> <a href="https://app.codecov.io/gh/foldright/cffu/tree/2.x-dev"><img src="https://img.shields.io/codecov/c/github/foldright/cffu/2.x-dev?logo=codecov&logoColor=white" alt="Codecov"></a> <a href="https://qodana.cloud/projects/A61Yy/reports?branch=2.x-dev"><img src="https://img.shields.io/github/actions/workflow/status/foldright/cffu/qodana_code_quality.yml?branch=2.x-dev&logo=jetbrains&logoColor=white&label=qodana" alt="Qodana Code Inspections"></a> <a href="https://openjdk.java.net/"><img src="https://img.shields.io/badge/Java-8+-339933?logo=openjdk&logoColor=white" alt="Java support"></a> <a href="https://www.apache.org/licenses/LICENSE-2.0.html"><img src="https://img.shields.io/github/license/foldright/cffu?color=4D7A97&logo=apache" alt="License"></a> <a href="https://foldright.io/api-docs/cffu2/"><img src="https://img.shields.io/github/release/foldright/cffu?label=javadoc&color=339933&logo=read-the-docs&logoColor=white&filter=v2.*" alt="Javadocs"></a> <a href="https://central.sonatype.com/artifact/io.foldright/cffu2/versions"><img src="https://img.shields.io/maven-central/v/io.foldright/cffu2?logo=apache-maven&logoColor=white" alt="Maven Central"></a> <a href="https://github.com/foldright/cffu/releases"><img src="https://img.shields.io/github/release/foldright/cffu.svg?filter=v2.*" alt="GitHub Releases"></a> <a href="https://github.com/foldright/cffu/stargazers"><img src="https://img.shields.io/github/stars/foldright/cffu?style=flat" alt="GitHub Stars"></a> <a href="https://github.com/foldright/cffu/fork"><img src="https://img.shields.io/github/forks/foldright/cffu?style=flat" alt="GitHub Forks"></a> <a href="https://github.com/foldright/cffu/issues"><img src="https://img.shields.io/github/issues/foldright/cffu" alt="GitHub Issues"></a> <a href="https://github.com/foldright/cffu/graphs/contributors"><img src="https://img.shields.io/github/contributors/foldright/cffu" alt="GitHub Contributors"></a> <a href="https://github.com/foldright/cffu"><img src="https://img.shields.io/github/repo-size/foldright/cffu" alt="GitHub repo size"></a> <a href="https://gitpod.io/#https://github.com/foldright/cffu"><img src="https://img.shields.io/badge/Gitpod-ready to code-339933?label=gitpod&logo=gitpod&logoColor=white" alt="gitpod: Ready to Code"></a> </p>

๐Ÿ“– English Documentation | ๐Ÿ“– ไธญๆ–‡ๆ–‡ๆกฃ


๐Ÿ‘‰ Java CompletableFuture-Fu ("CF-Fu", pronounced "Shifu" ๐Ÿฆ) is a tiny library that improves the CompletableFuture(CF) usage experience and reduces misuse, enabling more convenient, efficient, and safe use of CF in your application. ๐Ÿ˜‹๐Ÿš€๐Ÿฆบ

Welcome ๐Ÿ‘๐Ÿ’–

<a href="#dummy"><img src="https://user-images.githubusercontent.com/1063891/230850403-87ff74de-1acb-4aff-b9b4-632e4e51e225.png" width="23%" align="right" alt="shifu" /></a>

  • For suggestions and questions, submit an Issue
  • For contributions and improvements, play fork and pull request dance

<!-- START doctoc generated TOC please keep comment here to allow auto update --> <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> <!-- END doctoc generated TOC please keep comment here to allow auto update -->

๐Ÿ”ง Features

โ˜˜๏ธ Completing missing functionality in business development

  • ๐Ÿช More convenient features, such as:
    • Support for returning overall results of multiple input CFs instead of returning CF<Void> without input CF results (CompletableFuture#allOf)
      • Such as methods allResultsFailFastOf / mSupplyFailFastAsync / thenMApplyMostSuccessAsync
    • Support for directly running multiple Actions instead of wrapping them into CompletableFutures first
      • Such as methods mSupplyAsync / mRunFailFastAsync / thenMApplyAllSuccessAsync
      • i.e. multiple instruction, single data (MISD) style processing
    • Support for async parallel processing of collection data, instead of wrapping data with actions into CompletableFutures first
      • Such as methods CfParallelUtils#parApplyFailFastAsync / CfParallelUtils#thenParAcceptAnySuccessAsync
      • i.e. single instruction, multiple data (SIMD) style processing
    • Support for inputting collections of CFs / Actions instead of converting them to array first
      • Such as methods CfIterableUtils#allResultsFailFastOf / CfIterableUtils#mSupplyFailFastAsync / CfIterableUtils#thenMApplyMostSuccessAsync
    • Support for setting a default business thread pool via CffuFactory#builder(executor) method, instead of repeatedly passing business thread pool parameters during async execution
    • Support for handling specific exception types via catching methods instead of handling all Throwable exceptions (CompletableFuture#exceptionally)
  • ๐Ÿšฆ More efficient and flexible concurrent execution strategies, such as:
    • AllFailFast strategy: fail fast when any of the multiple input CFs complete exceptionally instead of futilely waiting for all CFs to complete (CompletableFuture#allOf)
    • AnySuccess strategy: Return the first successful CF result instead of the first completed but possibly exceptional CF (CompletableFuture#anyOf)
    • AllSuccess strategy: Return successful results from multiple CFs, returning specified default values for exceptional CFs
    • MostSuccess strategy: Return successful results from multiple CFs within a specified time, returning specified default values for exceptional or timed-out CFs
    • All(Complete) / Any(Complete)

Related Skills

View on GitHub
GitHub Stars240
CategoryDevelopment
Updated10h ago
Forks34

Languages

Java

Security Score

100/100

Audited on Mar 31, 2026

No findings