[Twisted-Python] Simultaneously client-server app

Minh Luu minh.luu at toll.com.au
Fri Jul 11 02:55:23 EDT 2003


Twisted Masters,

Has anyone any suggestion on how I might start on the following task using Twisted?

What I would like to do is a type of server that will serve a number of clients and itself is a client of other servers. It requires a spool of worker threads to perform time-consuming tasks and database related tasks.  All the network I/O will be handled by a single async thread using select. A simple diagram below demo the model I would like to implement.

Thank you.

                 |  |  |  |       ^  ^  ^  ^
                 |  |  |  |       |  |  |  |
                 V  V  V  V       |  |  |  |
            +-------------------------------------------------+
            |    Network I/O Thread                           |
            |    (async-connection using select)              |
            +-------------------------------------------------+
                             |                            ^
                             |                            |  
                             V                            |
            +----------------------------------------+    |
            |   Queue Thread                         |    |
            |   (to dispatch to the worker threads)  |    |
            +----------------------------------------+    |
               |                                          |
               |   +---------------------------------+    |
               +-->|  Worker Thread                  |----+
               |   +---------------------------------+    |
               |                                          |
               |   +---------------------------------+    |
               +-->|  Worker Thread                  |----+
               |   +---------------------------------+    |
               |                                          |
               .                                          |
               .                                          |
               |   +---------------------------------+    |
               +-->|  Worker Thread                  |----+
                   +---------------------------------+
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20030711/16db3b97/attachment.htm 


More information about the Twisted-Python mailing list