Server side Tracker.autorun
mitar opened this issue · 4 comments
It is crazy that Tracker.autorun does not work on the server side? You can just use it for non-yielding code. So no database queries.
I would love to see this work, and with database query support too!
It seems this package (a bit old) is trying to address this.
Some related tickets:
It seems MDG is open to the idea, but they have not yet done anything to fully support it, just some basic effort:
(To be thoroughly honest, Tracker is mostly designed for client use, which doesn't have yielding, and while we've done the bare minimum to make it kind of work on the server, the core team has never really sat down and put serious effort into making Tracker truly server native. For example, while it makes sense to have a single global concept of "current computation" on the client, it probably makes less sense on the server, where maybe it should be fiber-dependent or DDP-client-dependent or something. It doesn't necessarily make sense that a slow recomputation for an autorun that is correlated to a specific user connection should affect the performance of an autorun correlated to another user. Hopefully at some point there will be an iteration of Tracker focused on making it truly server-native.)
I made this package: https://github.com/peerlibrary/meteor-server-autorun