module similar to Perl Net::Server

Andrew Bennetts andrew-pythonlist at puzzling.org
Wed Feb 5 18:45:38 EST 2003


On Wed, Feb 05, 2003 at 04:53:25PM +0300, Rayed Al-Rashed wrote:
> >
> >
> >Well, I think you'll find that Twisted will decrease your overall 
> >complexity
> >-- partly because it *is* asynchronous.  Not dealing with threads saves me
> >so much time (calling deferToThread doesn't count as dealing with threads,
> >because Twisted does it for you :).
> > 
> >
> May be I should give it a try, specially the DB connectivity.
> I have worked with asyncore to build a chat server, it saved me the 
> complexity of inter-(thread/process) communication, but it was very 
> confusing.

Well, if you thought asyncore was nice, then Twisted kicks butt! :)

Trivial asyncore vs. Twisted comparison:
    http://twistedmatrix.com/products/echo_server

> >On the other hand, event-driven asynchronous programming is a bit different
> >to normal synchronous programming.
> >
> I guess this is my problem, I might need some time to think in 
> asynchronous way ;)

Twisted has lots of nice abstractions that make most of the pain go away.
To a large extent I think of programming in Twisted as like being
multithreaded without needing mutexes ;)

> >Out of curiousity, what sort of server are you writing?
> >
> Radius server, I already built it with SocketServer and I was hoping to 
> find pre-threading module with similar interface.

I've never used it, but I hear the pyrad package now supports Twisted...

-Andrew.






More information about the Python-list mailing list