Skip to content

Add throttling for resource notifications #92

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 6 commits into from
Apr 29, 2025
Merged

Add throttling for resource notifications #92

merged 6 commits into from
Apr 29, 2025

Conversation

jakemac53
Copy link
Contributor

This is in anticipation of potentially modeling runtime errors as resources, so they might be updated often. But it is in general a good practice to throttle these.

Copy link

PR Health

Changelog Entry ✔️
Package Changed Files

Changes to files need to be accounted for in their respective changelogs.

@jakemac53 jakemac53 requested a review from natebosch April 29, 2025 20:58
@@ -37,8 +37,19 @@ base mixin ResourcesSupport on MCPServer {
final List<({ResourceTemplate template, ReadResourceHandler handler})>
_resourceTemplates = [];

/// The list of currently subscribed resources by URI.
final Set<String> _subscribedResources = {};
/// The currently subscribed resource [StreamController]s by URI.
Copy link
Contributor

Choose a reason for hiding this comment

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

can you be more specific of what type of URI is expected? (e.g. file uri, absolute, etc.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These can be any URI, as defined by the server.

@auto-submit auto-submit bot merged commit 110b54b into main Apr 29, 2025
24 checks passed
@auto-submit auto-submit bot deleted the throttling branch April 29, 2025 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants