Node.js: event-based comet insted of periodic ajax requests?
Core features of node.js as far as I understood are (also): event-based structure and very cheap "threads" sleeping. So, it may be really good idea (and probably cheaper) to do not create periodic ajax requests, but to hold events like "user A got a new message" and let user's A conn开发者_运维技巧ection thread sleep until this event happens.
How do you think - what would be cheaper for server (RAM, CPU) to use?
Take a look at socket.io for pushing data. It really is very good.
精彩评论