Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

python-socketio vs Gevent-socketio

I am choosing a python library to write a live-chat function page embed in my website.

I found two libraries that based on Socket.IO, python-socketio and gevent-socketio:

From python-socketio doc:

Python implementation of the Socket.IO realtime server.

From gevent-socketio doc:

Socket.IO is a WebSocket-like abstraction that enables real-time communication between a browser and a server. gevent-socketio is a Python implementation of the protocol.

You see, both are implementation of Socket.IO.

I want to choose one of them(or if there is a better library than them I don't know).

My consideration points are bellow:

  1. My python backend project is written by Django/Django-Rest-Framework framework.

  2. My project is in a hurry, I want to use a more convenient lib, write less code to realize my requirement.

I surfed the internet, the gevent-socketio live-chat must use the gevent python WSGI server, I am not sure whether this is a limit for my project deployment.

Who can give me the suggestion to choose the best library for me?

like image 374
aircraft Avatar asked Dec 24 '22 10:12

aircraft


1 Answers

Sorry to answer this question so late. I am the author and maintainer of python-socketio, so I'm going to give you a biased response.

The gevent-socketio project hasn't been maintained in a while. As of today, the most current commit on the repository on GitHub is from September 2016, which is about 2.5 years ago. The version of the Socket.IO protocol supported by this package is the 0.x releases, which are old and totally incompatible with the Socket.IO 1.x and 2.x releases.

My python-socketio project was born as a result of the slowing down in the development of gevent-socketio, and in particular due to never receiving an upgrade to support the 1.x release of the Socket.IO protocol. Unlike my competitor, I decided to not add a hard dependency on gevent. Instead, I have a plugin system that allowed me to support many different web server frameworks. As of today, the support extends to eventlet, gevent, uwsgi (combined with gevent), asyncio (combined with aiohttp, sanic or any ASGI complaint server) and Tornado. This package supports all the 1.x and 2.x releases of the Socket.IO protocol, and I make sure it can connect to the official JavaScript clients, which is what most people use with it. In case it is useful, a Python based Socket.IO client is also included.

Hope this helps!

like image 119
Miguel Avatar answered Dec 25 '22 22:12

Miguel