当前位置:网站首页>SAP 电商云 Spartacus SSR Optimization Engine 几处 timeout 的执行顺序
SAP 电商云 Spartacus SSR Optimization Engine 几处 timeout 的执行顺序
2022-07-31 12:34:00 【华为云】
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,将负载通过构造函数参数传入。
边栏推荐
- 基于verilog的CRC校验(汇总)
- 最长算术(暑假每日一题 11)
- 消息队列面试题(2022最新整理)
- Adding data nodes and decommissioning data nodes in the cluster
- [Shader] Shader official example [easy to understand]
- 快速学完数据库管理
- How does the SAP ABAP OData service support the $filter (filter) operation trial version
- Indoor real-time laser SLAM control method based on biological excitation neural network
- PyQt5 rapid development and actual combat 10.2 compound interest calculation && 10.3 refresh blog clicks
- 系统集成项目管理工程师(软考中级)知识点总结【挣值分析】【关键路径】
猜你喜欢
golang八股文整理(持续搬运)
Markdown编辑器语法
电商rpa是什么意思?跟电商rpi是一个意思吗?
Full GC (Ergonomics)排查分析
Optimization of five data submission methods
硬盘分区,拓展C盘,不重装系统,不重装D盘软件的全教程。
PyQt5 rapid development and actual combat 10.2 compound interest calculation && 10.3 refresh blog clicks
荣耀手机参数写错,客服认为没错
PyQt5 rapid development and actual combat 9.7 Automated testing of UI layer
线性表的基本概念
随机推荐
电脑重要文件很多,如何备份比较安全?
集群中增加数据节点与退役数据节点
深圳某游戏研发公司每个工位都装监控,网友:堪比“坐牢”!
Hybrid brain-computer interface system based on steady-state visual evoked potentials and attentional EEG
双非一本进字节了!!纯干货分享
【核心概念】图像分类和目标检测中的正负样本划分以及架构理解
[Shader] Shader official example [easy to understand]
WPF中TabControl动态获取当前选中的TabItem
Double non-one into bytes!!Pure dry goods sharing
Architecture Camp | Module 8
NameNode (NN) and SecondaryNameNode (2NN) working mechanism
ipv4和ipv6对比(IPV4)
Basic use of dosbox [easy to understand]
硬盘分区,拓展C盘,不重装系统,不重装D盘软件的全教程。
NameNode故障处理的两种方法
TOGAF10标准读书会第2场活动精彩继续,高光时刻回顾!
立一个flag
快速学完数据库管理
立方体IV(暑假每日一题 10)
vivado里那些看不懂的原语