Package org.mycore.util.concurrent
Class MCRPrioritySupplier<T>
java.lang.Object
org.mycore.util.concurrent.MCRPrioritySupplier<T>
- Type Parameters:
T
- the type of results supplied by this supplier
- All Implemented Interfaces:
Comparable<MCRPrioritizable>
,Supplier<T>
,MCRPrioritizable
A supplier with a priority.
stackoverflow
- Author:
- Matthias Eichner
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionget()
long
int
Returns the priority.use this instead ofCompletableFuture.supplyAsync(Supplier, Executor)
This method keep the priorityMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.mycore.util.concurrent.MCRPrioritizable
compareTo
-
Constructor Details
-
MCRPrioritySupplier
-
-
Method Details
-
get
-
getPriority
public int getPriority()Description copied from interface:MCRPrioritizable
Returns the priority.- Specified by:
getPriority
in interfaceMCRPrioritizable
-
getCreated
public long getCreated()- Specified by:
getCreated
in interfaceMCRPrioritizable
-
runAsync
use this instead ofCompletableFuture.supplyAsync(Supplier, Executor)
This method keep the priority- Parameters:
es
-- Returns:
-