当前位置:网站首页>SAP e-commerce cloud Spartacus SSR Optimization Engine execution sequence of several timeouts
SAP e-commerce cloud Spartacus SSR Optimization Engine execution sequence of several timeouts
2022-07-31 12:44:00 【HUAWEI CLOUD】
SSR optimization engine option 代码:
const ngExpressEngine = NgExpressEngineDecorator.get(engine, { timeout: 9000, concurrency: 1, forcedSsrTimeout:90000, maxRenderTime:1000, cache: true, cacheSize: 10, renderingStrategyResolver: (req) => RenderingStrategy.DEFAULT});(1) 首先是 MaxRenderTimeout 超时到达:
显示 log:
然后是:


最后:
注意,这里的 log 不会打印到控制台上:
这两个 timeout 值,谁的数值大,则谁对应的 timeout callback 就会后执行.
以 CmsSetPageSuccessIndex 为例:

运行时该 Action 类包含三大字段:
(1) meta
(2) payload
(3) type
meta
meta 包含的 loader 字段和 meta 本身都是一个 object.
meta.entityId 和 entityType 是该 action payload 的标识位.

loader 表明该 entity 加载状况.
payload
包含的业务数据:

type
字符串类型.
从 上图 Prototype 能看出,CmsSetPageSuccessIndex 的原型链类为 EntitySuccessAction.
这一点也能从其实现代码看出:
export class CmsSetPageSuccessIndex extends StateUtils.EntitySuccessAction { readonly type = CMS_SET_PAGE_SUCCESS_INDEX; constructor(pageContext: PageContext, payload: Page) { super(pageContext.type, pageContext.id, payload); }}查看 EntitySuccessAction 的实现:

属性1,meta 属性,定义在该类里.
属性2,payload,通过构造函数参数定义.
属性3,type,定义在上图81行,然后被 CmsSetPageSuccessIndex 重载.
EntitySuccessAction 构造函数接收三个参数:entityType,id 和 payload.
通过 entityType 和 id,生产出 meta 字段.
entitySuccessMeta 可以看成一个构造器或者工厂函数:
根据 entityType 和 id,生产出 EntityLoaderMeta, 后者是 EntityMeta 和 LoaderMeta 的联合.
export interface EntityMeta { entityType: string; entityId: string | string[]; entityRemove?: boolean;}export interface LoaderMeta { entityType: string; loader: { load?: boolean; error?: any; success?: boolean; };}采用三个点的语法,是因为这两个 interface,都有同名字段:entityType
LoaderMeta 的运行时数据,通过构造器 loadMeta 制造:
export function loadMeta(entityType: string): LoaderMeta { return { entityType: entityType, loader: { load: true, }, };}EntityMeta 字段的值,通过 entityMeta 构造:
export function entityMeta(type: string, id: string | string[]): EntityMeta { return { entityType: type, entityId: id, };}运行时通过 PageEffect 从 Commerce Cloud 后台读取 CMS 数据成功后,新建 ActionClass,将负载通过构造函数参数传入.

边栏推荐
- PyQt5快速开发与实战 9.7 UI层的自动化测试
- The function of SQL GROUP BY dependence
- JVM 运行时数据区与JMM 内存模型详解
- JS列表数据通过递归实现树形结构
- Use IN List Population in Your JDBC Application to Avoid Cursor Cache Contention Issues
- FIFO深度计算学习记录(汇总)
- 0x80070570 The file or directory is damaged and cannot be deleted (how to delete 0x80070091)
- 查看Mysql数据库版本
- ERROR 2003 (HY000) Can‘t connect to MySQL server on ‘localhost3306‘ (10061)
- Indoor real-time laser SLAM control method based on biological excitation neural network
猜你喜欢
随机推荐
ASM外部冗余是否可以替换磁盘
想吃菌子,当然是自己上山找了
连续变量离散化教程
机器学习基本概念
【OpenCV】-边缘检测汇总示例
硬盘分区,拓展C盘,不重装系统,不重装D盘软件的全教程。
Full GC (Ergonomics)排查分析
Centos7 install mysql5.7 steps (graphical version)
IDEA连接MySQL数据库并执行SQL查询操作
给你一个大厂面试的机会,你能面试上吗?进来看看!
使用openssl命令生成证书和对应的私钥,私钥签名,公钥验签
Banyan Tree Loan GPU Hardware Architecture
NameNode (NN) and SecondaryNameNode (2NN) working mechanism
AMBA APB学习记录(AMBA 3/4)
365天挑战LeetCode1000题——Day 044 最大层内元素和 层次遍历
认知—运动康复医疗机器人应用设计
带有对称约束切换线性系统的结构可控性
PyQt5快速开发与实战 10.1 获取城市天气预报
Use IN List Population in Your JDBC Application to Avoid Cursor Cache Contention Issues
Getting started with jmeter performance testing steps (performance testing tool jmeter)









