Created
April 1, 2019 12:36
-
-
Save DevCodo/6b5edbc1087b0770905e04f8696440bd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //https://www.html5rocks.com/ru/tutorials/workers/basics/ | |
| var worker = new Worker('doWork.js'); | |
| worker.addEventListener('message', function(e) { | |
| console.log('Worker said: ', e.data); | |
| }, false); | |
| worker.postMessage('Hello World'); | |
| //doWork.js (объект Worker) | |
| self.addEventListener('message', function(e) { | |
| self.postMessage(e.data); | |
| }, false); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment