Main idea of OPA design
It helps us a lot to resolve OPA issue if we understand the logic of OPA implementation thoroughly.
Take my Lead OPA for example, in our test case implementation, we simply design several command and execute them
All those command simply assemble an object and delegate to waitFor function:
The waitFor implementation is the essential part of OPA engine. The parameter passed through waitFor is simply inserted to an internal queue maintained by OPA engine. For every item inserted in the queue, besides the properties specified in our test code, there are some additional default properties like timeout : 15 seconds and pollingInterval: 400 milliseconds.
For the test case “Add Lead View Test1”, there are totally 29 items in the queue to be executed one by one. You can check queue content from variable queue in line 298 below.
Remember, our test code will never immediately trigger OPA execution. Instead, the code will just insert directive into queue and return. The real OPA execution is triggered by Opa.emptyQueue, see line 73 below. The directive in the head of queue is fetched via Array.prototype.shift, and internal polling is started via internalWait.
And below is the core of OPA queue handling engine:
When you study OPA source code, you will meet with many usage of promise & resolve & reject in the source code, this is also the case in our latest UI5 framework. See this article for more detail.
要获取更多Jerry的原创文章,请关注公众号"汪子熙":
相关文章
- IDEA优化配置,提高启动和运行速度[通俗易懂]
- IDEA更换主题
- 最新IDEA激活码,永久有效(idea破解教程)
- idea创建java项目_使用IDEA创建java项目(hello word)
- idea maven project 包加载出错问题
- 2022.10最新IntelliJ IDEA激活码、Idea注册码(持续更新中)
- idea 添加Tomcat_懂车帝怎么添加
- idea创建springboot父子工程_Springboot框架
- idea tomcat catalina log乱码_xshell查看日志乱码怎么解决
- idea全局搜索快捷键修改_idea整个项目替换
- IDEa快捷键_idea进入方法快捷键
- idea在方法上自动生成注释_idea中如何快速注释
- idea使用技巧
- 正版JetBrains的IDEA账号,可直接登录使用IDEA
- IDEA 最新永久 2022 年12月激活码!!_IDEA 和 Eclipse 使用对比
- 2022 IntelliJ IDEA 破解,最新idea破解教程(永久有效)
- idea程序包org不存在-IDEA 程序包不存在
- idea mapper xml 文件报红
- IntelliJ IDEA 2022 for Mac(智能编码Java开发工具)
- java和IntelliJ IDEA的区别,附带Idea激活码哈
- Java开发环境配置“IntelliJ IDEA”
- 【错误记录】Mac 中 IntelliJ IDEA 运行 Python 程序报错 ( End of statement expected )
- 玩转 IntelliJ IDEA Mac 常用快捷键
- ORA-30513: cannot create system triggers of INSTEAD OF type ORACLE 报错 故障修复 远程处理
- 利用Idea构建MySQL驱动开发环境(ideamysql驱动)
- Linux下如何安装IDEA?(linux安装idea)
- 在Idea中快速配置Redis环境(idea中配置redis)
- 实现Idea集成Oracle数据库(idea集成oracle)
- 深入探索Idea运行Oracle的可能性(idea运行oracle)
- 利用Idea添加Oracle进行开发(idea添加oracle)
- IDEA中快速搭建Redis连接(redis连接idea)