网络 消息;消息跨线程发送;消息是异步的
So what exactly goes on with this onmessage/postMessage paradigm?
那么这个 onmessage/postMessage 范型到底说明了什么?
Control returns immediately from PostMessage and the message gets processed later.
控制会从PostMessage立即返回,该消息是后来才处理的。
This data is then sent back to the parent thread by using the postMessage function.
该数据随后会被通过 postMessage 函数发送回母线程。
The last line of Listing 1 shows how the Worker is initiated—by calling its postMessage function.
清单 1 中的最后一行展示如何通过调用 Worker 的 postMessage 函数来启动它。
When you finish processing the data in the Worker script, you invoke the postMessage function to send data back to the main thread.
当您处理完 Worker 脚本中的数据时,调用 postMessage 函数将数据返回主线程。