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: README.md
+64-75Lines changed: 64 additions & 75 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1483,7 +1483,8 @@ This setup allows you to:
1483
1483
1484
1484
### Custom Reconnection Scheduling for Non-Persistent Environments
1485
1485
1486
-
By default, the Streamable HTTP client transport uses `setTimeout` to schedule automatic reconnections after connection failures. However, this approach doesn't work well in non-persistent environments like serverless functions, mobile apps, or desktop applications that may be suspended.
1486
+
By default, the Streamable HTTP client transport uses `setTimeout` to schedule automatic reconnections after connection failures. However, this approach doesn't work well in non-persistent environments like serverless functions, mobile apps, or desktop applications that may be
1487
+
suspended.
1487
1488
1488
1489
The SDK allows you to provide a custom reconnection scheduler to handle these scenarios:
1489
1490
@@ -1498,9 +1499,9 @@ The SDK allows you to provide a custom reconnection scheduler to handle these sc
1498
1499
1499
1500
```typescript
1500
1501
typeReconnectionScheduler= (
1501
-
reconnect: () =>void,// Function to call to initiate reconnection
1502
-
delay:number,// Suggested delay in milliseconds
1503
-
attemptCount:number// Current reconnection attempt count (0-indexed)
1502
+
reconnect: () =>void, // Function to call to initiate reconnection
1503
+
delay:number, // Suggested delay in milliseconds
1504
+
attemptCount:number// Current reconnection attempt count (0-indexed)
1504
1505
) =>void;
1505
1506
```
1506
1507
@@ -1512,27 +1513,24 @@ import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/
1512
1513
1513
1514
// Serverless scheduler: reconnect immediately without setTimeout
0 commit comments