Node's event loop is non-blocking. It's perfectly fine to run events on an interval and it can mix in with other events (like http requests). As long as no event blocks the process for a long time, things will run smoothly. As far as polling your database, well, if there is no notification or trigger mechanism that node can subscribe to or get notified by then I guess polling is ok. Just be aware that your database probably won't like the load if you poll it very often.
On Wed, Mar 14, 2012 at 7:15 PM, g sambolic <[email protected]> wrote: > Hi, > I setup a small socket server that for reducing mysql queries stores data > in JS objects. > Server runs on Interval 2 sek. > Can I expecting any problems with this approach? > > Are there any better solution for store and manipulate data on server that > runs in Interval? > Are is safe to run server in Interval?. Need timed events, so I use > Interval to check if something is need to happend. > > -- > Job Board: http://jobs.nodejs.org/ > Posting guidelines: > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > You received this message because you are subscribed to the Google > Groups "nodejs" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/nodejs?hl=en?hl=en > -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en
