 c2e77e4429
			
		
	
	
	c2e77e4429
	
	
	
		
			
			* docs: add Asynchronous Messages Fiddle example * Update docs/fiddles/communication/two-processes/asynchronous-messages/main.js Co-Authored-By: John Kleinschmidt <jkleinsc@github.com> * Update docs/fiddles/communication/two-processes/asynchronous-messages/index.html Co-Authored-By: John Kleinschmidt <jkleinsc@github.com>
		
			
				
	
	
		
			27 lines
		
	
	
	
		
			873 B
			
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
	
		
			873 B
			
		
	
	
	
		
			HTML
		
	
	
	
	
	
| <!DOCTYPE html>
 | |
| <html>
 | |
|   <head>
 | |
|     <meta charset="UTF-8">
 | |
|   </head>
 | |
|   <body>
 | |
|     <div>
 | |
|       <div>
 | |
|         <h1>Asynchronous messages</h1>
 | |
|         <i>Supports: Win, macOS, Linux <span>|</span> Process: Both</i>
 | |
|         <div>
 | |
|           <div>
 | |
|             <button id="async-msg">Ping</button>
 | |
|             <span id="async-reply"></span>
 | |
|           </div>
 | |
|           <p>Using <code>ipc</code> to send messages between processes asynchronously is the preferred method since it will return when finished without blocking other operations in the same process.</p>
 | |
| 
 | |
|           <p>This example sends a "ping" from this process (renderer) to the main process. The main process then replies with "pong".</p>
 | |
|         </div>
 | |
|       </div>
 | |
|     </div>
 | |
|     <script>
 | |
|       // You can also require other files to run in this process
 | |
|       require('./renderer.js')
 | |
|     </script>
 | |
|   </body>
 | |
| </html>
 |