RemoteMessenger Initialization Handshake

System Design · flowchart diagram · NOASSERTION

Illustrates the initialization handshake between two RemoteMessenger instances, one in the Main Process and one in a WebView, using a RemoteReady message.

Source: https://github.com/laurent22/joplin/blob/9e46f80713c5b7c13d40a21b137539b644748ac0/readme/dev/spec/plugins.md
Curated by laurent22
Mermaid flowchart IPC RemoteMessenger Joplin WebView MainProcess

Mermaid source

flowchart
	postMessage1(["postMessage({ kind: RemoteReady, ... })"])
	rm1--1-->postMessage1--2-->rm2
	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 flow for setting up two RemoteMessenger instances. rm1 in the Main Process sends a postMessage with kind: RemoteReady. This message is then received by rm2 in the WebView, initiating the readiness handshake between the two processes.

When to use it

Use this diagram to explain how inter-process communication (IPC) channels are initialized and how readiness is established between different application components, such as a main process and a webview.

How to adapt it for your project

This pattern can be adapted for any two-way communication setup requiring an explicit readiness check. Modify message kinds, add more steps for authentication or capability negotiation, or extend to multiple communicating parties.

Key concepts