I am creating a program that has a class used locally, but I want the same class to be used in the same way over the network. This means that I need to be able to make synchronous calls to any of my public methods. The class reads and writes files, so I think XML-RPC is way too expensive. I created a basic rpc client / server using twisted examples, but I am having problems with the client.
c = ClientCreator(reactor, Greeter) c.connectTCP(self.host, self.port).addCallback(request) reactor.run()
This works for a single call, when the data is received, I call operator.stop (), but if I make more calls, the reactor will not restart. Is there anything else I should use for this? maybe another twisted module or another structure?
(I do not include details about how the protocol works, because the main thing is that I get only one call from this.)
Addition and clarification:
I shared a google document with notes on what I am doing. http://docs.google.com/Doc?id=ddv9rsfd_37ftshgpgz
I have a written version that uses a fuse and can combine several local folders at the point of connection of the fuse. File access is already being processed inside the class, so I want to have servers that give me access to the network for one class. After continuing the search, I suspect that pyro ( http://pyro.sourceforge.net/ ) may be what I'm really looking for (just based on reading their homepage right now), but I'm open to any suggestions.
I could achieve similar results using mount nfs and combining it with my local folder, but I want all peers to have access to the same federated file system, so that every computer had to sing an nfs server with the number of mounts nfs is equal to the number of computers on the network.
Conclusion: I decided to use rpyc as it gave me exactly what I was looking for. A server that stores an instance of a class that I can manipulate as if it were local. If anyone is interested, I posted my project on Launchpad ( http://launchpad.net/dstorage ).