One challenge to develop a high scalable asynchronous network messaging gateway is how you test it for functionality, load and performance. I eventually developed several Test Simulators and Drivers using Python Twisted, "an event-driven networking engine written in Python".
Twisted obviously is THE python framework if you want to develop a scalable asynchronous network application using Python. Personally, I think that Apache Mina has a very good chance to become the De facto java framework for developing NIO based network applications.
If you compare Twisted with Mina, they both adopt the "reactor pattern", they both have the goal to encapsulate/hide the complexity of Non-blocking network IO and provide a simple and elegant framework for developer to use. Actually, they are very similar at concept level as the following table shows:
Python Twisted | Apache MINA |
Protocol | ProtocolEncoder/ProtocolDecoder |
LineRecevier | TextLineEncoder/TextLineDecoder |
protocol.ClientFactory | IoConnector |
protocol.ServerFactory | IoAcceptor |
Deferred | IoFuture |
callback chain/errback chain | IoFilterChain |
reactor ThreadPool | ExecutorFilter |
No comments:
Post a Comment