开发者

Node.js: event-based comet insted of periodic ajax requests?

开发者 https://www.devze.com 2023-03-27 06:45 出处:网络
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 a

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

精彩评论

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