module similar to Perl Net::Server

Alex Martelli aleax at aleax.it
Thu Feb 6 10:19:45 CET 2003


Erik Max Francis wrote:

> Jp Calderone wrote:
> 
>>   The example is supposed to demonstrate that programs written that
>> -use-
>> Twisted are less complex.
> 
> An utterly trivial example like an echo server demonstrates no such
> thing.

When an echo server coded (for example) using the select module
takes about 60 lines, and one with the same scalability coded
with twisted.internet takes less than 20, then it does seem to
me that it IS a "demonstration" (in some sense of the word, though
not of course in that of "mathematical proof";-) that the latter
can produce highly scalable servers with less complications.

Sure, in real servers you'll have mucho code in addition to
the "react asynchronously to TCP requests" parts that make
up all of an echo-server.  If computing the results takes
(e.g) 100 lines, then the comparison becomes 120:160, not
20:60 any more; twisted.internet cannot simplify parts of your
code that have nothing to do with "serving per se" but rather
(e.g.) mathematical computations.

But working with highly-simplified "pure" examples can be a very
good technique for didactical purposes, including investigating
which module or package to use for some kinds of tasks, IMHO.


Alex





More information about the Python-list mailing list