File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
fern/products/sdks/overview/java/changelog Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 1+ ## 3.14.0
2+ ** ` (feat): ` ** Add support for WebSocket channels with bidirectional communication. Generated WebSocket clients
3+ provide automatic reconnection with exponential backoff, strongly-typed message handlers, and message
4+ queuing during disconnections. Clients are accessible via factory methods in subpackage clients.
5+
6+ ``` java
7+ // Create WebSocket client with path and query parameters
8+ RealtimeWebSocketClient ws = client. realtime(). realtimeWebSocket(
9+ " session-123" ,
10+ Optional . of(" gpt-4" ),
11+ Optional . of(0 )
12+ );
13+
14+ // Register handlers and connect
15+ ws. onReceive(message - > System . out. println(" Received: " + message. getAlpha()));
16+ ws. onConnected(() - > System . out. println(" Connected!" ));
17+ ws. connect(). get();
18+
19+ // Send typed messages
20+ ws. sendSend(SendEvent . builder()
21+ .sendText(" Hello WebSocket!" )
22+ .sendParam(42 )
23+ .build());
24+ ```
25+
26+
You can’t perform that action at this time.
0 commit comments