[Twisted-Python] Wrapping a Perspective

Christopher Armstrong radix at twistedmatrix.com
Thu Sep 6 10:05:21 EDT 2007

On 9/6/07, Phil Mayers <p.mayers at imperial.ac.uk> wrote:

> > I want to have my python code being called from an external process
> > via COM, and the external process will expect to be calling a class
> > method that will do something (blocking as long as required) and then
> > return the result. Rewriting the external app to deal with everything
> > being async is not an option.
> I suggest you abandon Perspective Broker; it's a fully async protocol,
> and by trying to call it in a sync/blocking manner you're going to get
> nowhere fast.
> Use something easy like XMLRPC. Twisted can implement that as a server
> with full deferred-capable semantics, it'll run over HTTPS, it's got
> authentication, it's got .net bindings etc.

That doesn't make any sense: XMLRPC can  be used asynchronously, as PB can.
Switching to XMLRPC won't change anything about his situation, the biggest
problem being that his COM interface doesn't support callbacks (?).

Rasjid: Being asynchronous on the server does not require being asynchronous
on the client. Communication boundaries let you do that. You should check to
see if the "being a COM server" interface allows you to accept a call, and
then later asynchronously trigger the response. Ideally, it would allow
this, and the client would be none the wiser about whether the
implementation of the server is blocking or not, while it's waiting for the
response to its request.

Christopher Armstrong
International Man of Twistery
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20070906/cc9fddf9/attachment.htm 

More information about the Twisted-Python mailing list