[Twisted-Python] servers that are also clients? (newbie question)

Eugene Coetzee projects at reedflute.com
Wed Mar 16 12:01:12 EST 2005

mikah at ceruleansoftware.com wrote:

>  My app is both a server and client at the same time. It takes
>requests from some clients, and also relays these requests
>(suitably reformatted) to a pair of third-party servers. In
>this sense, it is acting as a client (I intend to use
>ReconnectingClient for this).
I'm busy doing the same kind of thing.

I use a separate server/client factory which I connect with some 
abstraction layer I choose to call a conductor. The conductor also 
manages a buffer and uses callbacks into the server/client protocol 

I'm sure there must be a more clever Twisted way of doing this but I 
couldn't find any docs.

here is how the contraption starts up.

from eva_config import EvaConfig
from eva_conductor import Conductor
from controller import ControllerFactory
from courier import CourierClientFactory
from twisted.application import service,internet

controllerfactory = ControllerFactory(conductor)
courierclientfactory = CourierClientFactory(conductor)

Works for me.

Eugene Coetzee

Web                 -> www.reedflute.com

More information about the Twisted-Python mailing list