Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I do synchronous rpc calls
    primarykey
    data
    text
    <p>I'm building a program that has a class used locally, but I want the same class to be used the same way over the network. This means I need to be able to make synchronous calls to any of its public methods. The class reads and writes files, so I think XML-RPC is too much overhead. I created a basic rpc client/server using the examples from twisted, but I'm having trouble with the client.</p> <pre><code>c = ClientCreator(reactor, Greeter) c.connectTCP(self.host, self.port).addCallback(request) reactor.run() </code></pre> <p>This works for a single call, when the data is received I'm calling reactor.stop(), but if I make any more calls the reactor won't restart. Is there something else I should be using for this? maybe a different twisted module or another framework?</p> <p>(I'm not including the details of how the protocol works, because the main point is that I only get one call out of this.)</p> <p>Addendum &amp; Clarification:</p> <p>I shared a google doc with notes on what I'm doing. <a href="http://docs.google.com/Doc?id=ddv9rsfd_37ftshgpgz" rel="nofollow noreferrer">http://docs.google.com/Doc?id=ddv9rsfd_37ftshgpgz</a></p> <p>I have a version written that uses fuse and can combine multiple local folders into the fuse mount point. The file access is already handled within a class, so I want to have servers that give me network access to the same class. After continuing to search, I suspect pyro (<a href="http://pyro.sourceforge.net/" rel="nofollow noreferrer">http://pyro.sourceforge.net/</a>) might be what I'm really looking for (simply based on reading their home page right now) but I'm open to any suggestions.</p> <p>I could achieve similar results by using an nfs mount and combining it with my local folder, but I want all of the peers to have access to the same combined filesystem, so that would require every computer to bee an nfs server with a number of nfs mounts equal to the number of computers in the network.</p> <p><strong>Conclusion:</strong> I have decided to use rpyc as it gave me exactly what I was looking for. A server that keeps an instance of a class that I can manipulate as if it was local. If anyone is interested I put my project up on Launchpad (<a href="http://launchpad.net/dstorage" rel="nofollow noreferrer">http://launchpad.net/dstorage</a>).</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload