1
0
mirror of https://github.com/KokaKiwi/BarInsta synced 2024-11-22 14:47:29 +00:00

Add some TODO

This commit is contained in:
Ammar Githam 2021-05-23 20:03:34 +09:00
parent 7ca0d513dc
commit 51f3a348b7
2 changed files with 2 additions and 0 deletions

View File

@ -29,6 +29,7 @@ import java.util.concurrent.Executors
* Grouping tasks like this avoids the effects of task starvation (e.g. disk reads don't wait behind * Grouping tasks like this avoids the effects of task starvation (e.g. disk reads don't wait behind
* webservice requests). * webservice requests).
*/ */
// TODO replace with kotlin coroutines and Dispatchers
object AppExecutors { object AppExecutors {
val diskIO: Executor = Executors.newSingleThreadExecutor() val diskIO: Executor = Executors.newSingleThreadExecutor()
val networkIO: Executor = Executors.newFixedThreadPool(3) val networkIO: Executor = Executors.newFixedThreadPool(3)

View File

@ -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<>();