Skip to content

Commit 457d9a8

Browse files
committed
docs(olink): add diagrams
1 parent 9581b30 commit 457d9a8

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

docs/docs/features/olink.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,32 @@ The `UIoWorldHelloOLinkClient` class implements `IIoWorldHelloInterface` and con
108108
2. **Operations**: Calls are forwarded to the remote server. The client waits for the response.
109109
3. **Signals**: When the server emits a signal, the client receives it and broadcasts locally.
110110

111+
```mermaid
112+
graph TB
113+
subgraph Local[" Your Application "]
114+
Code[Application Code]
115+
end
116+
117+
subgraph Client[" OLink Client "]
118+
Interface["IIoWorldHelloInterface"]
119+
end
120+
121+
subgraph Transport[" WebSocket "]
122+
WS((WS))
123+
end
124+
125+
subgraph Remote[" Remote "]
126+
Server[OLink Server]
127+
end
128+
129+
Code -->|uses| Interface
130+
Interface <-->|requests| WS
131+
WS -.->|updates| Interface
132+
WS <-->|messages| Server
133+
```
134+
135+
*The client acts as a **Remote Proxy** - it implements the same interface as the backend service but forwards calls over WebSocket. Properties are cached locally for fast reads.*
136+
111137
### Properties
112138

113139
Properties are synchronized between client and server:
@@ -259,6 +285,37 @@ The OLink adapter is disabled on mobile platforms (iOS, Android, QNX). Mobile de
259285
2. **Handles remote requests**: Forwards property changes and operation calls to the wrapped implementation
260286
3. **Broadcasts updates**: Sends property changes and signals to all connected clients
261287

288+
```mermaid
289+
graph BT
290+
subgraph Local[" Your Backend "]
291+
Impl["IIoWorldHelloInterface<br/>(your implementation)"]
292+
end
293+
294+
subgraph Adapter[" OLink Adapter "]
295+
Handler[Request Handler]
296+
end
297+
298+
subgraph Transport[" WebSocket "]
299+
WS((WS))
300+
end
301+
302+
subgraph Remote[" Remote Clients "]
303+
C1[Client 1]
304+
C2[Client 2]
305+
CN[Client N]
306+
end
307+
308+
Handler -->|calls| Impl
309+
Impl -.->|notifies| Handler
310+
311+
C1 & C2 & CN -->|requests| WS
312+
WS -->|forwards| Handler
313+
Handler -.->|broadcasts| WS
314+
WS -.->|updates| C1 & C2 & CN
315+
```
316+
317+
*The adapter uses the **Adapter Pattern** - it wraps any `IIoWorldHelloInterface` implementation and exposes it over WebSocket. Multiple clients can connect simultaneously.*
318+
262319
### Properties
263320

264321
When a client requests a property change, the adapter receives the request, calls the wrapped implementation, and the property change is broadcast to all connected clients.

0 commit comments

Comments
 (0)