Package org.jgroups.util
Class Delayer<T>
- java.lang.Object
-
- org.jgroups.util.Delayer<T>
-
public class Delayer<T> extends java.lang.Object
Collects actions by key and executes them - if a predicate is true - every N ms.- Since:
- 5.3.1
- Author:
- Bela Ban
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
Delayer.Entry
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<T,Delayer.Entry>
map
protected long
timeout
-
Constructor Summary
Constructors Constructor Description Delayer(long timeout)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Delayer<T>
add(T key, java.util.function.Predicate<T> pred, java.util.function.Consumer<java.lang.Boolean> action)
Delayer<T>
clear()
int
done()
int
size()
long
timeout()
Delayer<T>
timeout(long t)
java.lang.String
toString()
-
-
-
Field Detail
-
timeout
protected long timeout
-
map
protected java.util.Map<T,Delayer.Entry> map
-
-
Method Detail
-
timeout
public long timeout()
-
size
public int size()
-
done
public int done()
-
add
public Delayer<T> add(T key, java.util.function.Predicate<T> pred, java.util.function.Consumer<java.lang.Boolean> action)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-