Browse Source

Add some TODO

renovate/org.robolectric-robolectric-4.x
Ammar Githam 3 years ago
parent
commit
51f3a348b7
  1. 1
      app/src/main/java/awais/instagrabber/utils/AppExecutors.kt
  2. 1
      app/src/main/java/awais/instagrabber/utils/Debouncer.java

1
app/src/main/java/awais/instagrabber/utils/AppExecutors.kt

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

1
app/src/main/java/awais/instagrabber/utils/Debouncer.java

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

Loading…
Cancel
Save