My situation is as follows: I have a collection in Mongo which gets updated with new items every few milliseconds, for example log items. I'm displaying these items on the frontend via publish/subscribe in a template, but because of the high volume the list updates so frequently that it's hard to read them. What I would like is to only have the list be updated every (few) seconds. I have tried to use sleep/timeouts on both the client and server side, as indicated here for example, without success so far.
- Can I still use publish/subscribe for this or should I switch a polling mechanism with Meteor.setInterval?
- Should the time interval part be on the publish or on the subscribe side?
- If publish/subscribe is correct for my scenario, how do I only show the updated data every few seconds?
DDP has a rate limiter. it's meant for defeating DDoS attacks, but i suppose it could be repurposed for what you want.
https://blog.meteor.com/rate-limiting-in-meteor-core-762b8ad2412f#.nw6fwlhji