ArchTaskExecutor 是androidx封装的线程接口
接口内部是 调用 Executors 开启4个线程的java线程池 Executors.newFixedThreadPool(4, new ThreadFactory() {
切换到子线程或者主线程
ArchTaskExecutor.getInstance().executeOnDiskIO
ArchTaskExecutor.getInstance().executeOnMainThread
java Executors 线程池管理类
1.固定大小的线程池
ExecutorService pool = Executors.newFixedThreadPool(5)
2.可变尺寸的线程池
ExecutorService pool = Executors.newCachedThreadPool();
3.单任务线程池
ExecutorService pool = Executors.newSingleThreadExecutor()
4.延迟连接池
ScheduledExecutorService pool = Executors.newScheduledThreadPool(2)