Skip to content
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

Plugins can't publish to $SYS topics #112

Open
bigsmoke opened this issue Aug 10, 2024 · 4 comments
Open

Plugins can't publish to $SYS topics #112

bigsmoke opened this issue Aug 10, 2024 · 4 comments

Comments

@bigsmoke
Copy link
Contributor

It would be nice if plugins could publish to $SYS topics, for plugin-specfic stats.

@bigsmoke
Copy link
Contributor Author

Bonus point if this can be done from non-worker threads.

@halfgaar
Copy link
Owner

One issue with publishing directly to $SYS is that the topics appear at a different time from FlashMQ's own $SYS topics. What we can perhaps do, is expose GlobalStats::setExtra to the plugin. That also takes care of the publishing from any thread.

@bigsmoke
Copy link
Contributor Author

I haven't quite glanced the overall role of GlobalStats yet. Are all these stats published simultaneously, with the same flags in terms of retention and such? If that's the case, I think that what you propose would be just what's needed for writing $SYS topics from plugins.

@bigsmoke
Copy link
Contributor Author

Although I could think of scenarios in which plugins would want to GlobalStats.setExtra() at a higher frequency than that the whole GlobalStats collection is published, I can't think of a scenario in which it matters (much) if the occasional intermediate stat is missed. I'm guessing that at the very least your idea will be more than sufficient for the majority of cases. And otherwise it might still be preferable to up the GlobalStats publish frequency rather than making it possible for plugins to directly publish to $SYS topics.

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

No branches or pull requests

2 participants