tisonkun commented on PR #17718:
URL: https://github.com/apache/pulsar/pull/17718#issuecomment-1251904103

   @congbobo184 Thanks for your explanation.
   
   ```java
           var f0 = new CompletableFuture<Void>();
           var f1 = f0.thenCompose((e) -> 
CompletableFuture.<Void>completedFuture(null));
           f1.thenAccept((e) -> System.out.println(1));
           var f2 = f1.thenCompose((e) -> 
CompletableFuture.<Void>completedFuture(null));
           f2.thenAccept((e) -> System.out.println(2));
           f0.complete(null);
   ```
   
   gives `1 2`; while
   
   ```java
           var f0 = new CompletableFuture<Void>();
           f0.thenAccept((e) -> System.out.println(1));
           f0.thenAccept((e) -> System.out.println(2));
           f0.complete(null);
   ```
   
   gives `2 1`.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to