Remote Messenger Initialization Handshake

System Design · flowchart diagram · NOASSERTION

Illustrates the initialization handshake process between a Main Process and a WebView using RemoteMessenger for cross-process communication.

Source: https://github.com/laurent22/joplin/blob/9e46f80713c5b7c13d40a21b137539b644748ac0/readme/dev/spec/plugins.md
Curated by laurent22
IPC WebView Main Process Messenger Flowchart Handshake Communication

Mermaid source

flowchart
	postMessage1(["postMessage({ kind: RemoteReady, ... })"])
	rm2--3-->postMessage1--4-->rm1
	subgraph MainProcess
		rm1["m1 = RemoteMessenger< MainProcessApi,WebViewApi >"]
	end
	subgraph WebView
		rm2["RemoteMessenger< WebViewApi,MainProcessApi >"]
	end

What this diagram shows

This flowchart details the initial communication steps for setting up RemoteMessenger instances between a Main Process and a WebView. It specifically highlights the RemoteReady message exchange, where rm2 (in WebView) sends a postMessage with kind: RemoteReady, which is then received by rm1 (in MainProcess).

When to use it

Use this diagram to understand or design the setup phase of inter-process communication (IPC) channels, especially when establishing communication between different isolated environments like a main application process and an embedded web view.

How to adapt it for your project

This pattern can be adapted for any client-server or inter-process communication setup requiring an initial handshake. The RemoteReady message can be extended with versioning or capability negotiation. The MainProcess and WebView can be replaced with any two communicating entities.

Key concepts