Package dev.failsafe.internal.util
Class FutureLinkedList
java.lang.Object
dev.failsafe.internal.util.FutureLinkedList
A LinkedList of CompletableFutures that removes a future from the list when it's completed.
This class is threadsafe.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescription(package private) FutureLinkedList.Node
(package private) FutureLinkedList.Node
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd()
Adds a new CompletableFuture to the list and returns it.Returns and removes the first future in the list, else returnsnull
if the list is empty.private void
remove
(FutureLinkedList.Node node)
-
Field Details
-
head
-
tail
-
-
Constructor Details
-
FutureLinkedList
public FutureLinkedList()
-
-
Method Details
-
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
Returns and removes the first future in the list, else returnsnull
if the list is empty. -
remove
-