So what exactly goes on with this onmessage/postMessage paradigm?
那么这个onmessage/postMessage 范型到底说明了什么?
The onmessage handler is what will receive this message; you use a simple closure for it.
onmessage处理器将接收这个消息;我们为它使用了一个简单的闭包。
To pass this data back, the postMessage function is called, which will invoke the onmessage callback function on the worker, as shown back in Listing 9.
为了将此数据传递回去,调用了 postMessage函数,由该函数在这个worker上调用onmessage回调函数,如清单 9中所示。
To receive messages, subscribe to the onMessage event
登记onMessage事件以接收信息
To receive messages, subscribe to the onMessage event
登记onMessage事件以接收信息
应用推荐