如何同时 运行 多个 doAsync?
How to run multiple doAsync at the same time?
我正在使用 Anko 库执行一些后台任务,我在前台服务中有一个 doAsync 运行ning。同时,我通过从数据库中获取数据来更新 recyclerview。但是问题是当前台服务doAsync 运行ning时,没有调用recyclerview更新doAsync。
我不知道为什么它不调用,我不能同时 运行 多个 doAsync 吗?
Asynchronous vs synchronous execution, what does it really mean?
doasync 运行s 在一个后台线程(不是多线程)中的 'first in first executed'(你解释的)序列中的多个任务;就像 asynctask 通过创建它的多个实例一样,你只是在创建多个任务;
如果您希望所有任务相对于彼此异步 运行,则需要为每个任务启动一个新的 thread;
我正在使用 Anko 库执行一些后台任务,我在前台服务中有一个 doAsync 运行ning。同时,我通过从数据库中获取数据来更新 recyclerview。但是问题是当前台服务doAsync 运行ning时,没有调用recyclerview更新doAsync。
我不知道为什么它不调用,我不能同时 运行 多个 doAsync 吗?
Asynchronous vs synchronous execution, what does it really mean?
doasync 运行s 在一个后台线程(不是多线程)中的 'first in first executed'(你解释的)序列中的多个任务;就像 asynctask 通过创建它的多个实例一样,你只是在创建多个任务;
如果您希望所有任务相对于彼此异步 运行,则需要为每个任务启动一个新的 thread;