title: Twisted distribute callRemote across servers
body: <p>I'm running a client which makes remote calls to my server, both written with twisted. The methods running on the server side can be quite long to return, and they're eating mostly CPU in Python code so threading won't be of any help here. </p>
  
  <p>I've tried a lot of stuff but eventually I think I'm going to run several instances of twisted servers to distribute the tasks. </p>
  
  <p>So I'm telling my servers to listen on several sockets (let's say I create them using <code>serverFromString</code> on <code>socket_1</code> for server 1 and on <code>socket_2</code> for server 2), and I'm connecting my client on these sockets with 2 calls to <code>connectUNIX</code> with <code>socket_1</code> and <code>socket_2</code> as arguments.</p>
  
  <p>So far I managed to create the servers listening on the ports I want them to, but I'm not sure how to tell my client to distribute callRemote across the sockets. When I compute several <code>callRemote</code> it seems that only one server is actually being used. How do I do that ?</p>
  
  <p>P.S. : I tried using <code>multiprocessing</code> but my methods on the server side are full of unpicklable objects so no chance ; also the API of <code>spawnProcess</code> is utterly non compliant with the code I'm calling. Also I'm not willing to use an undocumented unmaintained project so <code>Ampoule</code> is not an option here.</p>
  
  <p>Edit : No answer so I guess the question wasn't clear enough. Basically it all boils down to : can I pass a 'port' or 'socket' argument to <code>callRemote</code> so I can manage on which server I'm running the remote calls ?</p>
  
  <p>Basically I have a django/uwsgi client in which I call <code>reactor.connectUNIX(my_port)</code>. I redirect all the calls made in my python code to a <code>threads.blockingCallFromThread(reactor, callRemote, args)</code>. The remote calls go to <code>my_port</code>, though I don't really know where/how the argument is passed. On the server side the application is launched with <code>twisted.scripts._twistd_unix.UnixApplicationRunner</code>, and the server listens on <code>my_port</code></p>
  
  <p>I'd like to start several servers on different addresses and have my client dispatch the remote calls among the servers. I don't know if I'm clear yet, I would gladly add more precisions.</p>