[Twisted-Python] Perspective Broker vs AMP
exarkun at divmod.com
Mon Mar 31 07:46:44 EDT 2008
On Mon, 31 Mar 2008 09:00:40 +0100, Simon Pickles <sipickles at hotmail.com> wrote:
>You may have seen my recent posts about data comms across nodes of server
>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 AMP, this seems similar - the
>client uses callRemote() to execute remote methods on the amp server.
>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
In addition to the other suggestions that have been made in this thread,
notice that PBClientFactory.login takes two arguments: the credentials
object used for authentication and an optional "client" object which
defaults to None. The value of this parameter is made available to your
realm in the `mind´ parameter. This means you can pass a reference to
login for this parameter and the server can use it to make calls onto the
client whenever it wants, rather than having to wait for a subsequent
call made by the client.
More information about the Twisted-Python