开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜