|
@ -6,6 +6,7 @@ import java.util.concurrent.ScheduledExecutorService; |
|
|
import java.util.concurrent.ScheduledFuture; |
|
|
import java.util.concurrent.ScheduledFuture; |
|
|
import java.util.concurrent.TimeUnit; |
|
|
import java.util.concurrent.TimeUnit; |
|
|
|
|
|
|
|
|
|
|
|
// TODO replace with kotlinx-coroutines debounce |
|
|
public class Debouncer<T> { |
|
|
public class Debouncer<T> { |
|
|
private final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1); |
|
|
private final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1); |
|
|
private final ConcurrentHashMap<T, TimerTask> delayedMap = new ConcurrentHashMap<>(); |
|
|
private final ConcurrentHashMap<T, TimerTask> delayedMap = new ConcurrentHashMap<>(); |
|
|
xxxxxxxxxx