开发者

using nodejs instead of comet for longpolling

开发者 https://www.devze.com 2023-02-27 09:31 出处:网络
开发者_JS百科The idea is to use nodejs instead of comet for longpolling. The intention is to spot changes in database and flush the update to several users.
开发者_JS百科

The idea is to use nodejs instead of comet for longpolling. The intention is to spot changes in database and flush the update to several users. Any ideas ? Thank you


comet is a grouping term for ajax technologies. It's a way of doing long polling.

node.js is evented IO. Specifically you would use it to run a HTTP server.

node.js does not mix well with your current serverside (probably php). Yes you can use node.js with socket.io to do communication between client and server.

I would personally advice againts using mysql as your database for node though. It's more suited to document based noSQL databases.


I can't comment on comet but for your specific scenario I would advise you to go with socket.io for pushing the updates from the server.

Take a look at this example > https://github.com/andrewdavey/vogue

See how he is using socket.io to push the stuff to the client. MySql is not recommended but it's fairly workable.


Node.js and Comet are not the same thing. A server written in JavaScript running in Node can use Comet or WebSockets (both nicely abstracted in the module socket.io).

0

精彩评论

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