[Twisted-Python] pb: async call in remote method

Sorin C. soso_pub at yahoo.com
Fri Apr 16 15:47:16 MDT 2004


Hi all,

I have a client and server that talk to each other
through pb.
The situation is the following:

The client calls a remote method:
"""
d = obj.callRemote('getValue', someParam)
d.addCallback(self.gotValue)
"""

On the server side:
"""
class PbValue(pb.Referenceable):
  def remote_getValue(self, someParam)
    result = processAsyncRequest(someParam)
    return notYetReceivedResult
"""

The problem is that processAsyncRequest is
asynchronous, sends a request to another server (not
Python) and returns without waiting for response, and
so there is no result to return from the remote method
back to the client at this point. 
Is it possible to somehow defer (funny heh) the
response that remote_getValue should send back to the
client until the result from processAsyncRequest
arrives?

Thanks,
Sorin


	
		
__________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online by April 15th
http://taxes.yahoo.com/filing.html




More information about the Twisted-Python mailing list