Server-Client push notification with Python
have a look on Python tornado http://www.tornadoweb.org/.
It is in fact a non-blocking webserver and you have a WebSocketHandler object which might be very useful for what you want to do.
http://www.tornadoweb.org/en/stable/websocket.html
Regards
Comments
-
ntcong about 2 years
I'm building an client application, which connect to a server and wait for signal from server to do something (think about chat app). For example: user 1 has client 1 and 2, user 2 has client 3, the server would send the message to the channel "user 1" and only client 1 and 2 will have the message.
I know about Websocket and Long-polling, but can't find a server which is self-hosted and easy to test. Initially I want to make a proof-of-concept first before dive in later.
Nginx push stream seems to fit my need, I can create a channel, and notify all client connect to that channel, seem good enough to use, but I can't find any Python client implement
AutoBahn and some other Python server seem only create one channel and broadcast.
Can someone give me a correct direction.
-
ntcong over 11 yearsseems good, but what I need is a channel, for example: user 1 has client 1 and 2, user 2 has client 3, the server would send the message to the channel "user 1" and only client 1 and 2 will have the message. From what I read ZeroMQ doesn't fit it, right ?
-
Nicolas Barbey over 11 yearsI think it does. Have a look at the pipelie pattern: api.zeromq.org/2-2:zmq-socket
-
ntcong over 11 yearsEnded up deciding with Tornado (specially the Socket.IO with Tornado) or Nginx Push Stream
-
andrefsp over 11 yearsExcellent choice. =) Tornado + socket.io its a brilliant combination for WebSocket programming.