Skip to content

Streamable HTTP - resume streams on disconnect #332

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Apr 15, 2025
Merged

Streamable HTTP - resume streams on disconnect #332

merged 10 commits into from
Apr 15, 2025

Conversation

ihrpr
Copy link
Contributor

@ihrpr ihrpr commented Apr 13, 2025

As per spec servers might support resumability and redelivery.

Introducing resumability and re-delivery of events for disconnection within the same client.

  • maintaining a map of streamID per request
  • moved a special case for standalone stream to a map for simplicity
  • adding StreamableHTTPReconnectionOptions interface for custom reconnection and backoff
  • adding example of start-notification-stream' tool which starts notifications for that can be used for testing

Follow ups:

  • resume long running requests from a new instance of the client

@ihrpr ihrpr requested a review from jspahrsummers April 13, 2025 20:57
@ihrpr ihrpr changed the base branch from main to streamablehttp-server-tests April 13, 2025 20:58
Copy link
Member

@jspahrsummers jspahrsummers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't had a chance to look at the examples or tests in depth yet, but pointed out some things I think we need to change before getting this in.

* Maximum backoff time between reconnection attempts in milliseconds.
* Default is 30000 (30 seconds).
*/
maxReconnectionDelay: number;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's probably a library on npm that can do some of this out of the box.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the logic is minimal, can come back to this later if it's non-blocking?

Base automatically changed from streamablehttp-server-tests to main April 15, 2025 08:07
@ihrpr ihrpr requested a review from jspahrsummers April 15, 2025 10:04
Copy link
Member

@jspahrsummers jspahrsummers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thankyou

I don't have bandwidth to review the tests and examples, but the main implementation looks good to me now.

@ihrpr ihrpr merged commit 9ed2254 into main Apr 15, 2025
4 checks passed
@ihrpr ihrpr deleted the resumability branch April 15, 2025 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants