mirror of
https://github.com/KokaKiwi/BarInsta
synced 2024-11-22 06:37:30 +00:00
Add some TODO
This commit is contained in:
parent
7ca0d513dc
commit
51f3a348b7
@ -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)
|
||||||
|
@ -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…
Reference in New Issue
Block a user