Kyle
Kyle

Reputation: 31

Is it possible to write an IM server in python? (be able to handle the heavy connections)

i wanna write an IM server in python, but i'm not sure if python can handle the heavy connections?

Thanks in advance.

Upvotes: 2

Views: 2861

Answers (3)

Denis
Denis

Reputation: 3780

gevent is a Python network library based on libevent that is capable of handling thousands of connections. Read the introduction here.

Upvotes: 1

Wolph
Wolph

Reputation: 80061

Yes, you could :)

For example: SecondLife has written a library to support non-blocking IO, you can find it at: http://eventlet.net/

The beauty of Python is, you can optimize the code when it's needed. If some part of your code is executed a lot you can simply replace it with a C function to speed up your entire program without much effort.

Upvotes: 2

user47322
user47322

Reputation:

Omegle is written in Python and as of writing is sustaining 7,057 concurrent online users.

It's not so much about the choice of language, but the efficiency of your code and how well it is optimized.

while true:
    # nothing

isn't going to be any slower than

while (1) ;

Upvotes: 2

Related Questions