[Twisted-Python] Perspective Broker vs AMP
p.mayers at imperial.ac.uk
Mon Mar 31 06:55:39 EDT 2008
Simon Pickles wrote:
> You may have seen my recent posts about data comms across nodes of
> server network.
> Phil kindly pointed me towards PB and AMP which, after some fiddling
> both look viable. However, I do have one question: If clients can
> request remote data from the server, is the reverse possible?
> As I understand PB, a client can get the root object of a
> PBServerFactory, thru which it can call methods with the 'remote_'
> prefix. I'm not clear how this can work in the other direction. As for
Well, this is a contrived example (since you could just return the
def remote_foo(self, client):
d = doThing().addCallback(self.thing_result, client)
def thing_result(self, result, client):
def remote_thing(self, thing):
# do something
d = self.server.getRootObject().addCallback(self.callServer2)
def callServer2(self, server):
That is - when you callRemote() you can pass pb.Referenceable as
arguments, and the other end call callRemote on those objects.
> AMP, this seems similar - the client uses callRemote() to execute remote
> methods on the amp server.
No idea about AMP
> Since I have node clients all talking through a server, I need the
> client to make requests to the server, which in turn requests the
> appropriate data from the corresponding client.
> Thanks for any advice on this
More information about the Twisted-Python