-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
ActorSystem local registry for topics #31053
Comments
I think that would be nice. |
Another use case where this would be useful: Imagine a HTTP or gRPC endpoint where clients subscribe and publish to a topic with more or less dynamic topic names (let's say potentially infinite over time) sent by the clients. We'd want many clients subscribing for the same topic to only mean a published message is sent to the node twice. We also don't want each client connecting to do a one off publish to have to wait for the list of subscribers from the receptionist before publishing. For this we'd need such a registry and a also add Topic actor TTL, counted after last subscriber unsubscribes or a message is published. That way the short lived topic can stay around a while for additional incoming publish or subscribers but go away if not used. |
Waiting for review in #32262 |
The current topic API expects users to spawn and keep track of their topics themselves (multiple instances of the same topic in the same actor system is allowed).
Often when using topics, in a clustered app, I expect that you are after one topic actor instance per node and topic. Implementing that isn't a lot of work but it could be nice with an extension spawning topics making sure the same topic only spawns one actor, and that the protocol is the same (at runtime), something like:
The text was updated successfully, but these errors were encountered: