[Twisted-Python] Fast RPC
bob at redivi.com
Sat Jul 2 16:27:28 EDT 2005
On Jul 2, 2005, at 9:37 AM, William Waites wrote:
> It looks like this has come up once or twice on the list under the
> guyse of "how do I make synchronous calls to PB from another
> application" with no clear answer. It seems to be hard to do
> because of the design of PB. Use XMLRPC is the usual response.
> Here's the situation. I have an embedded python interpreter
> running inside of Yate. Because of the way Yate deals with
> threads and signals, it seems to be hard to get a twisted
> reactor to run inside the embedded interpreter. I also have a
> twisted process that wraps an API around a database and
> exposes it over XMLRPC and PB. The embedded interpreter needs
> to get at various bits of data by making RPC calls to this API.
threadedselectreactor (in svn, will be in 2.1) runs the blocking part
of the reactor in a separate thread, so you could do blocking PB-
based RPC with that..
I just checked in an example of how you might be able to use it:
Not really tested or thought out very well, but it should work.
More information about the Twisted-Python