Socket.IO vs. Twisted [closed]

試著忘記壹切 提交于 2019-12-05 08:09:58

Comparing Twisted and Socket.io is comparing apples to a truck carrying apples. Twisted is a library that provides event oriented programming functionality to Python. In javascript that's merely javascript itself (be it node.js or a web browser or even rhino).

A more apt comparison is to compare Socket.io on node.js with Socket.io on Python. While there is one main implementation of a socket.io server on node there are several for Python:

(taken from the socket.io wiki: https://github.com/learnboost/socket.io/wiki)

You can even implement your own socket.io in Python using Twisted if you want. The socket.io protocol is documented here: https://github.com/LearnBoost/socket.io-spec. But that would defeat the purpose of socket.io - it abstracts away low level details of real time web communications and allows you to concentrate on writing your business logic.

On the client side you'd deploy the same socket.io script to the browser regardless of what language you decide to write the server in.

With regards to which language to choose: my rule of thumb is choose the language you're most comfortable with. You're going to have enough problems debugging your business logic. Don't complicate it by using an unfamiliar language.

Both languages are battle hardened (yes, even node.js which is surprising considering how young it is). Python for example is used in production on such high traffic services as Dropbox. Node is currently in use on such high traffic services as LinkedIn mobile.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!