Skip to content

add memory clean up on gochannel subscribe topics when they no longer have any more subscribers #561

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dkotik
Copy link
Contributor

@dkotik dkotik commented May 5, 2025

This allows publishing and subscribing to narrowly focused topics that include random data like UUIDs in topic name. Without this change, memory usage will grow indefinitely in a long-running service as the map grows larger and larger with keys pointing to empty slices.

The change is small, but it allows using Watermill Gochannel like NATS - having a topic per HTTP request, for example.

… have any subscribers

This allows publishing and subscribing to narrowly focused topics that
include random data like UUIDs in topic name. Without this change,
memory usage will grow indefinitely in a long-running service as the map
grows larger and larger with keys pointing to empty slices.
@dkotik dkotik changed the title add memory clean up on gochannel subscribe topics when they no longer… add memory clean up on gochannel subscribe topics when they no longer have any more subscribers May 5, 2025
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.

1 participant