Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于RN中JS调用RN的5ms问题 #3

Open
xiaosenlin opened this issue Aug 12, 2018 · 0 comments
Open

关于RN中JS调用RN的5ms问题 #3

xiaosenlin opened this issue Aug 12, 2018 · 0 comments

Comments

@xiaosenlin
Copy link

你好,作者,刚学习RN没多久,发现您的ReactNative源码分析系列文章,感觉很棒,拜读过程中,有一些细节问题没搞明白,想请教一下,在ReactNative源码篇:通信机制这篇介绍JS调用Java代码时,讲到
1 . 如果如果5m(MIN_TIME_BETWEEN_FLUSHES_MS)以内,则继续在队列中等待Java层的事件来驱动它。
2. 事实上,在队列中,如果是Java方法调用JS方法,则会把之前队列里存的方法通过JSCExecutor::flush()进行处理。

两个问题

  1. 5ms内,加到队列中,如果一直没有Java层的事件来驱动,那会一直放在队列里吗?
  2. Java调用JS,会把队列里的方法通过flush()进行处理,不用考虑事件过期吗?

其实就是一个疑问,什么时候Java层的事件会来驱动处理这个5ms内添加到队列中的方法?

RN小白,谢谢指点。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant