在 CompletableFuture 中返回 autocloseable object 并在 whenComplete 中使用它 - Return autocloseable object inside a CompletableFuture and use it in whenComplete
我想在 CompletableFuture 中返回一个可自动关闭的 object 并在 whenComplete 中使用它,而无需稍后手动关闭它。 这是我试过的代码,但当然它不会工作,因为当我返回 Jedis object 时它会自动关闭。我没有任何其他想法。 ...