cordova - Cordova + ngrx/effect fire and forget long running 方法冻结 UI
问题描述
在 Cordova 应用程序中,火和雾的效果是这样实现的:
@Effect({dispatch: false})
onFireAndForget$ = this.actions$
ofType(MyActionTypes.FireAndForget)
.pipe(
tap(action => longRunningMethod(action.payload))
)
应用程序的 UI 冻结,直到“longRunningMethod”的执行完成。有没有办法在单独的线程上执行长时间运行的方法而不影响其他应用程序进程?
解决方案
It turned out, that problem is not in effect implementation neither in application. UI sloweness was experienced only during test Cordova app on device with inspecting it in chrome on PC. No problems, when run application normally.
推荐阅读
- python - Python for 循环执行非常慢!如何做的更好
- python - statsmodels.tsa._stl.STL "无法确定 endog 的周期"
- bash - run.sh 包含激活 conda 环境 - 从 bash 调用它可以工作,但 crontab 不能
- react-native - React Native 如何同时旋转和平移
- android - TextInputLayout 中的 endIconTint 不起作用
- java - 是否可以使用最新的 Eclipse 和 JDK11 构建混合的 Kotlin 和 Java 应用程序?
- javascript - JS当我在表中添加新行时,前一个被清除
- spring-boot - AuthenticationCredentialsNotFoundException with Method security using jwt authentication
- timezone - Jira Jeti 错误地格式化日期时间字段
- python - QMainWindow 在被 QDialog 调用后没有被激活