@FunctionalInterface
public interface DispatchPredicate
ScheduledDataLoaderRegistry to decide whether to dispatch or not| Modifier and Type | Method and Description |
|---|---|
default DispatchPredicate |
and(DispatchPredicate other)
Returns a composed predicate that represents a short-circuiting logical
AND of this predicate and another.
|
static DispatchPredicate |
dispatchIfDepthGreaterThan(int depth)
This predicate will return true if the
DataLoader.dispatchDepth() is greater than the specified depth. |
static DispatchPredicate |
dispatchIfLongerThan(java.time.Duration duration)
This predicate will return true if the
DataLoader has not be dispatched
for at least the duration length of time. |
default DispatchPredicate |
negate()
Returns a predicate that represents the logical negation of this
predicate.
|
default DispatchPredicate |
or(DispatchPredicate other)
Returns a composed predicate that represents a short-circuiting logical
OR of this predicate and another.
|
boolean |
test(java.lang.String dataLoaderKey,
DataLoader<?,?> dataLoader)
This predicate tests whether the data loader should be dispatched or not.
|
boolean test(java.lang.String dataLoaderKey,
DataLoader<?,?> dataLoader)
dataLoaderKey - the key of the data loader when registereddataLoader - the dataloader to dispatchdefault DispatchPredicate and(DispatchPredicate other)
other - a predicate that will be logically-ANDed with this
predicateother predicatedefault DispatchPredicate negate()
default DispatchPredicate or(DispatchPredicate other)
other - a predicate that will be logically-ORed with this
predicateother predicatestatic DispatchPredicate dispatchIfLongerThan(java.time.Duration duration)
DataLoader has not be dispatched
for at least the duration length of time.duration - the length of time to checkstatic DispatchPredicate dispatchIfDepthGreaterThan(int depth)
DataLoader.dispatchDepth() is greater than the specified depth.
This will act as minimum batch size. There must be more than `depth` items queued for the predicate to return true.depth - the value to be greater thanDataLoader.dispatchDepth() is greater than the specified depth.