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
{{ message }}
Repository navigation
Allow customizable reconnection behavior for non-persistent clients #1162
The _scheduleReconnection method in StreamableHTTPClientTransport is currently private and uses setTimeout for scheduling reconnection attempts. This doesn't work well for clients that aren't running continuously (e.g., serverless functions, mobile apps that need push notifications to wake up).
not for this PR but it would be good to be able to overwrite this method. For clients which aren't running all the time this will need some input externally from the client itself to wake it up.
Proposed Solution
Make reconnection behavior customizable, either by:
Allowing _scheduleReconnection to be overridden (make it protected or provide a hook)
Accepting a custom scheduler function in the transport options
Emitting an event when reconnection is needed, letting the client handle scheduling
Use Cases
Serverless/edge functions that can't maintain long-running timers
Mobile apps that need to schedule reconnection via platform-specific mechanisms (push notifications, background fetch)
Desktop apps that need to handle sleep/wake cycles
Activity
feat: add custom reconnection scheduler for non-persistent environments
feat(client): add reconnectionScheduler to StreamableHTTPClientTransport