开发者

Python Twisted - Prospective Broker and Server-Side Deffereds

Background: I have a gtk client that uses twisted and perspective broker to perform remote object execution and server/client communication. This works great for me and was a breeze to start working with.

I have amqp (Message Queue/MQ) services that I also need to communicate from the client. I have a security model in place around the client and server through twisted, and I don't want the clients to talk to the Message Queue Server directly, nor do I want another dependency on amqp libraries for the clients.

Ideally I would like the client to send a request to the server through perspective broker, the Perspective Broker Server to send an amqp request to another server on behalf of the client, and the client to receive an acknowledgment when the PB server receives a response from the Message Queue Server.

Question: On the server side, how do I defer the response inside one of the servers pb methods? More importantly what's the most efficient way to connect an outgoing request back to an incoming request and still preserve the Twis开发者_如何学Pythonted event driven paradigms?


On the server side, how do I defer the response inside one of the servers pb methods?

Easy. Return the Deferred from the remote_ method. Done.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜