You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/content/docs/client/rpc-link.md
+21-1Lines changed: 21 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -89,7 +89,7 @@ const link = new RPCLink({
89
89
90
90
## Event Source Configuration
91
91
92
-
Customize the retry logic for event sources using these options:
92
+
Customize the retry logic for event sources (the mechanism behind [Event Iterator](/docs/event-iterator)) using these options:
93
93
94
94
-**eventSourceMaxNumberOfRetries:** Maximum retry attempts.
95
95
-**eventSourceRetryDelay:** Delay between retries.
@@ -115,3 +115,23 @@ const link = new RPCLink<ClientContext>({
115
115
:::tip
116
116
You should disable event source retries when streaming results from a chatbot AI.
117
117
:::
118
+
119
+
## Event-Source Ping Interval
120
+
121
+
To keep EventSource connections alive (the mechanism behind [Event Iterator](/docs/event-iterator)), `RPCLink` periodically sends a ping comment to the server. You can configure this behavior using the following options:
122
+
123
+
-`eventSourcePingEnabled` (default: `true`) – Enables or disables pings.
124
+
-`eventSourcePingInterval` (default: `5000`) – Time between pings (in milliseconds).
125
+
-`eventSourcePingContent` (default: `''`) – Custom content for ping messages.
126
+
127
+
```ts
128
+
const link =newRPCLink({
129
+
eventSourcePingEnabled: true,
130
+
eventSourcePingInterval: 5000, // 5 seconds
131
+
eventSourcePingContent: '',
132
+
})
133
+
```
134
+
135
+
:::warning
136
+
These options for sending [Event Iterator](/docs/event-iterator) from client to the server, not from the server to client as used in [RPCHandler](/docs/rpc-handler#event-source-ping-interval) or [OpenAPIHandler](/docs/openapi/openapi-handler#event-source-ping-interval).
To keep EventSource connections alive (the mechanism behind [Event Iterator](/docs/event-iterator)), `OpenAPIHandler` periodically sends a ping comment to the client. You can configure this behavior using the following options:
93
+
94
+
-`eventSourcePingEnabled` (default: `true`) – Enables or disables pings.
95
+
-`eventSourcePingInterval` (default: `5000`) – Time between pings (in milliseconds).
96
+
-`eventSourcePingContent` (default: `''`) – Custom content for ping messages.
To keep EventSource connections alive (the mechanism behind [Event Iterator](/docs/event-iterator)), `RPCHandler` periodically sends a ping comment to the client. You can configure this behavior using the following options:
72
+
73
+
-`eventSourcePingEnabled` (default: `true`) – Enables or disables pings.
74
+
-`eventSourcePingInterval` (default: `5000`) – Time between pings (in milliseconds).
75
+
-`eventSourcePingContent` (default: `''`) – Custom content for ping messages.
0 commit comments