Class FutureLinkedList


  • public final class FutureLinkedList
    extends java.lang.Object
    A LinkedList of CompletableFutures that removes a future from the list when it's completed.

    This class is threadsafe.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      (package private) static class  FutureLinkedList.Node  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.concurrent.CompletableFuture<java.lang.Void> add()
      Adds a new CompletableFuture to the list and returns it.
      java.util.concurrent.CompletableFuture<java.lang.Void> pollFirst()
      Returns and removes the first future in the list, else returns null if the list is empty.
      private void remove​(FutureLinkedList.Node node)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FutureLinkedList

        public FutureLinkedList()
    • Method Detail

      • add

        public java.util.concurrent.CompletableFuture<java.lang.Void> add()
        Adds a new CompletableFuture to the list and returns it. The returned future will be removed from the list when it's completed.
      • pollFirst

        public java.util.concurrent.CompletableFuture<java.lang.Void> pollFirst()
        Returns and removes the first future in the list, else returns null if the list is empty.