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/adapters/http.md
+49Lines changed: 49 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -247,3 +247,52 @@ The `link` can be any supported oRPC link, such as [RPCLink](/docs/client/rpc-li
247
247
::: info
248
248
This only shows how to configure the http link. For full client examples, see [Client-Side Clients](/docs/client/client-side).
249
249
:::
250
+
251
+
## Event Iterator Options
252
+
253
+
HTTP adapters provide reliability features for streaming [Event Iterators](/docs/event-iterator):
254
+
255
+
```ts
256
+
const handler =newRPCHandler(router, {
257
+
eventIteratorInitialCommentEnabled: true,
258
+
eventIteratorInitialComment: 'start',
259
+
eventIteratorKeepAliveEnabled: true,
260
+
eventIteratorKeepAliveInterval: 5000,
261
+
eventIteratorKeepAliveComment: '',
262
+
})
263
+
264
+
const link =newOpenAPILink({
265
+
eventIteratorInitialCommentEnabled: true,
266
+
eventIteratorInitialComment: 'start',
267
+
eventIteratorKeepAliveEnabled: true,
268
+
eventIteratorKeepAliveInterval: 5000,
269
+
eventIteratorKeepAliveComment: '',
270
+
})
271
+
```
272
+
273
+
::: info
274
+
These options are available for HTTP-based handlers and links only.
275
+
:::
276
+
277
+
::: warning
278
+
Link options apply when streaming from **client to server**, not server to client (as with handlers). In most cases, you don't need to configure these on the link.
279
+
:::
280
+
281
+
### Initial Comment
282
+
283
+
Sends an initial comment immediately when the stream starts to flush response headers early. This allows the receiving side to establish the connection without waiting for the first event.
Copy file name to clipboardExpand all lines: apps/content/docs/client/rpc-link.md
-22Lines changed: 0 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -153,28 +153,6 @@ const link = new RPCLink({
153
153
154
154
Unlike traditional SSE, the [Event Iterator](/docs/event-iterator) does not automatically retry on error. To enable automatic retries, refer to the [Client Retry Plugin](/docs/plugins/client-retry).
155
155
156
-
## Event Iterator Keep Alive
157
-
158
-
:::warning
159
-
These options for sending [Event Iterator](/docs/event-iterator) from **client to the server**, not from **the server to client** as used in [RPCHandler Event Iterator Keep Alive](/docs/rpc-handler#event-iterator-keep-alive) or [OpenAPIHandler Event Iterator Keep Alive](/docs/openapi/openapi-handler#event-iterator-keep-alive).
160
-
161
-
**In 99% of cases, you don't need to configure these options.**
162
-
:::
163
-
164
-
To keep [Event Iterator](/docs/event-iterator) connections alive, `RPCLink` periodically sends a ping comment to the server. You can configure this behavior using the following options:
165
-
166
-
-`eventIteratorKeepAliveEnabled` (default: `true`) – Enables or disables pings.
167
-
-`eventIteratorKeepAliveInterval` (default: `5000`) – Time between pings (in milliseconds).
168
-
-`eventIteratorKeepAliveComment` (default: `''`) – Custom content for ping messages.
Copy file name to clipboardExpand all lines: apps/content/docs/openapi/client/openapi-link.md
-22Lines changed: 0 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -154,28 +154,6 @@ const link = new OpenAPILink({
154
154
155
155
Unlike traditional SSE, the [Event Iterator](/docs/event-iterator) does not automatically retry on error. To enable automatic retries, refer to the [Client Retry Plugin](/docs/plugins/client-retry).
156
156
157
-
## Event Iterator Keep Alive
158
-
159
-
:::warning
160
-
These options for sending [Event Iterator](/docs/event-iterator) from **client to the server**, not from **the server to client** as used in [RPCHandler Event Iterator Keep Alive](/docs/rpc-handler#event-iterator-keep-alive) or [OpenAPIHandler Event Iterator Keep Alive](/docs/openapi/openapi-handler#event-iterator-keep-alive).
161
-
162
-
**In 99% of cases, you don't need to configure these options.**
163
-
:::
164
-
165
-
To keep [Event Iterator](/docs/event-iterator) connections alive, `OpenAPILink` periodically sends a ping comment to the server. You can configure this behavior using the following options:
166
-
167
-
-`eventIteratorKeepAliveEnabled` (default: `true`) – Enables or disables pings.
168
-
-`eventIteratorKeepAliveInterval` (default: `5000`) – Time between pings (in milliseconds).
169
-
-`eventIteratorKeepAliveComment` (default: `''`) – Custom content for ping messages.
The `OpenAPILink` follows the same lifecycle as the [RPCLink Lifecycle](/docs/client/rpc-link#lifecycle), ensuring consistent behavior across different link types.
Copy file name to clipboardExpand all lines: apps/content/docs/openapi/openapi-handler.md
-16Lines changed: 0 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -102,22 +102,6 @@ const handler = new OpenAPIHandler(router, {
102
102
})
103
103
```
104
104
105
-
## Event Iterator Keep Alive
106
-
107
-
To keep [Event Iterator](/docs/event-iterator) connections alive, `OpenAPIHandler` periodically sends a ping comment to the client. You can configure this behavior using the following options:
108
-
109
-
-`eventIteratorKeepAliveEnabled` (default: `true`) – Enables or disables pings.
110
-
-`eventIteratorKeepAliveInterval` (default: `5000`) – Time between pings (in milliseconds).
111
-
-`eventIteratorKeepAliveComment` (default: `''`) – Custom content for ping comments.
The `OpenAPIHandler` follows the same lifecycle as the [RPCHandler Lifecycle](/docs/rpc-handler#lifecycle), ensuring consistent behavior across different handler types.
Copy file name to clipboardExpand all lines: apps/content/docs/rpc-handler.md
-16Lines changed: 0 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -83,22 +83,6 @@ const handler = new RPCHandler(router, {
83
83
})
84
84
```
85
85
86
-
## Event Iterator Keep Alive
87
-
88
-
To keep [Event Iterator](/docs/event-iterator) connections alive, `RPCHandler` periodically sends a ping comment to the client. You can configure this behavior using the following options:
89
-
90
-
-`eventIteratorKeepAliveEnabled` (default: `true`) – Enables or disables pings.
91
-
-`eventIteratorKeepAliveInterval` (default: `5000`) – Time between pings (in milliseconds).
92
-
-`eventIteratorKeepAliveComment` (default: `''`) – Custom content for ping comments.
0 commit comments