Skip to content

请问为什么只有 beforeLoad 和 afterLoad 是 AsyncHook,而其他的都是同步的呢? #494

Answered by zhoushaw
xcatliu asked this question in Q&A
Discussion options

You must be logged in to vote

因为我们想要尽可能的保证应用的渲染和销毁阶段是同步的,如果需要异步的行为可以放置在开始渲染阶段进行处理,否则在渲染过程中异步 hook 阻塞渲染会出现非常多不可预期的行为,并且在渲染过程中如果应用触发销毁操作会导致我们的沙箱无法正确恢复上下文

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by xcatliu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants