Question

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 Twisted event driven paradigms?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top