title: Is this a CompletableFuture chaining anti-pattern?
body: <p>Lately I have been applying a pattern where I chain futures together where for some future I don't care about the result but I do care it completed without exception before continuing the futures chain.</p>
  <p>What I do is using <em>thenCompose()</em> and then supply it with a CompletableFuture that always ends with <em>.thenApply(a)</em>. Example:</p>
  <pre class="lang-java prettyprint-override"><code>futureR
     .thenCompose(r -&gt; sequentialFutureTask1(r).thenApply(ignored -&gt; r))
     .thenCompose(r -&gt; sequentialFutureTask2(r).thenApply(ignored -&gt; r))
     .thenCompose(r -&gt; sequentialFutureTask3(r).thenApply(ignored -&gt; r))
  </code></pre>
  <p>I've even streamlined this with a helper method:</p>
  <pre class="lang-java prettyprint-override"><code>futureFoo
     .thenCompose(identityComposing(r -&gt; sequentialFutureTask1(r)))
     .thenCompose(identityComposing(r -&gt; sequentialFutureTask2(r)))
     .thenCompose(identityComposing(r -&gt; sequentialFutureTask3(r)))
  
  
  
  public static &lt;T&gt; Function&lt;T, CompletableFuture&lt;T&gt;&gt; identityComposing(Function&lt;T, CompletableFuture&lt;?&gt;&gt; c) {
      return r -&gt; cf.apply(r).thenApply(ignored -&gt; r);
  }
  </code></pre>
  <p>Is this an anti-pattern? It looks concise enough to me, but somehow I feel I missed some point.</p>