mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 09:32:43 +00:00 
			
		
		
		
	 1602663b9e
			
		
	
	
		1602663b9e
		
	
	
	
	
		
			
			This implementation completely ignores MessagePorts, and manually plumbs data through LocalSockets.
		
			
				
	
	
		
			18 lines
		
	
	
	
		
			526 B
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
	
		
			526 B
		
	
	
	
		
			HTML
		
	
	
	
	
	
| <script src="../include.js"></script>
 | |
| <script>
 | |
|     asyncTest((done) => {
 | |
|         let work = new Worker("worker.js");
 | |
|         let count = 0;
 | |
|         work.onmessage = (evt) => {
 | |
|             println("Got message from worker: " + JSON.stringify(evt.data));
 | |
|             count++;
 | |
|             work.postMessage({"msg": "marco"});
 | |
|             if (count === 2) {
 | |
|                 println("DONE");
 | |
|                 work.onmessage = null;
 | |
|                 work.terminate();
 | |
|                 done();
 | |
|             }
 | |
|         };
 | |
|     });
 | |
| </script>
 |