Class FutureLinkedList

java.lang.Object
dev.failsafe.internal.util.FutureLinkedList

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

This class is threadsafe.

  • Field Details

  • Constructor Details

    • FutureLinkedList

      public FutureLinkedList()
  • Method Details

    • add

      public CompletableFuture<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 CompletableFuture<Void> pollFirst()
      Returns and removes the first future in the list, else returns null if the list is empty.
    • remove

      private void remove(FutureLinkedList.Node node)