File tree Expand file tree Collapse file tree
android/guava/src/com/google/common/util/concurrent
futures/listenablefuture1/src/com/google/common/util/concurrent
guava/src/com/google/common/util/concurrent Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6565 * need to adapt between {@code CompletableFuture} and {@code ListenableFuture}, consider <a
6666 * href="https://github.com/lukas-krecan/future-converter">Future Converter</a>.)
6767 *
68+ * <h3>{@link ClosingFuture}</h3>
69+ *
70+ * <p>If the steps of your pipeline create objects that must be closed when the computation is done,
71+ * such as database connections or file handles, use {@code ClosingFuture}. It supports the same
72+ * kinds of derived steps as {@code FluentFuture} but closes those objects once the pipeline
73+ * completes, fails, or is cancelled.
74+ *
6875 * <h2>Extension</h2>
6976 *
7077 * If you want a class like {@code FluentFuture} but with extra methods, we recommend declaring your
Original file line number Diff line number Diff line change 7272 * <li><a href="https://dagger.dev/producers.html">Dagger Producers</a>
7373 * </ul>
7474 *
75- * <p>If you do chain your operations manually, you may want to use {@link FluentFuture}.
75+ * <p>If you do chain your operations manually, you may want to use {@link FluentFuture}. If those
76+ * operations create objects that must be closed when the computation is done, see {@link
77+ * ClosingFuture}.
7678 *
7779 * @author Kevin Bourrillion
7880 * @author Nishant Thakkar
Original file line number Diff line number Diff line change 4747 * <li><a href="https://dagger.dev/producers.html">Dagger Producers</a>
4848 * </ul>
4949 *
50+ * <p>If the operations in your chain create objects that must be closed when the computation is
51+ * done, such as database connections or file handles, consider {@link ClosingFuture}. It closes
52+ * them once the whole computation completes, fails, or is cancelled.
53+ *
5054 * <p>The main purpose of {@link #addListener addListener} is to support this chaining. You will
5155 * rarely use it directly, in part because it does not provide direct access to the {@code Future}
5256 * result. (If you want such access, you may prefer {@link Futures#addCallback
Original file line number Diff line number Diff line change 4747 * <li><a href="https://dagger.dev/producers.html">Dagger Producers</a>
4848 * </ul>
4949 *
50+ * <p>If the operations in your chain create objects that must be closed when the computation is
51+ * done, such as database connections or file handles, consider {@link ClosingFuture}. It closes
52+ * them once the whole computation completes, fails, or is cancelled.
53+ *
5054 * <p>The main purpose of {@link #addListener addListener} is to support this chaining. You will
5155 * rarely use it directly, in part because it does not provide direct access to the {@code Future}
5256 * result. (If you want such access, you may prefer {@link Futures#addCallback
Original file line number Diff line number Diff line change 6565 * need to adapt between {@code CompletableFuture} and {@code ListenableFuture}, consider <a
6666 * href="https://github.com/lukas-krecan/future-converter">Future Converter</a>.)
6767 *
68+ * <h3>{@link ClosingFuture}</h3>
69+ *
70+ * <p>If the steps of your pipeline create objects that must be closed when the computation is done,
71+ * such as database connections or file handles, use {@code ClosingFuture}. It supports the same
72+ * kinds of derived steps as {@code FluentFuture} but closes those objects once the pipeline
73+ * completes, fails, or is cancelled.
74+ *
6875 * <h2>Extension</h2>
6976 *
7077 * If you want a class like {@code FluentFuture} but with extra methods, we recommend declaring your
Original file line number Diff line number Diff line change 7272 * <li><a href="https://dagger.dev/producers.html">Dagger Producers</a>
7373 * </ul>
7474 *
75- * <p>If you do chain your operations manually, you may want to use {@link FluentFuture}.
75+ * <p>If you do chain your operations manually, you may want to use {@link FluentFuture}. If those
76+ * operations create objects that must be closed when the computation is done, see {@link
77+ * ClosingFuture}.
7678 *
7779 * @author Kevin Bourrillion
7880 * @author Nishant Thakkar
Original file line number Diff line number Diff line change 4747 * <li><a href="https://dagger.dev/producers.html">Dagger Producers</a>
4848 * </ul>
4949 *
50+ * <p>If the operations in your chain create objects that must be closed when the computation is
51+ * done, such as database connections or file handles, consider {@link ClosingFuture}. It closes
52+ * them once the whole computation completes, fails, or is cancelled.
53+ *
5054 * <p>The main purpose of {@link #addListener addListener} is to support this chaining. You will
5155 * rarely use it directly, in part because it does not provide direct access to the {@code Future}
5256 * result. (If you want such access, you may prefer {@link Futures#addCallback
You can’t perform that action at this time.
0 commit comments