← Back to team overview

txamqp-user team mailing list archive

Re: few general questions

 

On Thu, Oct 08, 2009 at 05:41:35PM +0200, Fabrizio Mancini wrote:
> Hi Jacopo
> 
> On Thu, Oct 8, 2009 at 4:56 PM, <jacopo.pecci@xxxxxxxxx> wrote:
> 
> > I recently started playing with txAMPQ and I have 5 basic questions, I hope
> > someone could help me:
> > I am basing my questions on Esteve?s code in http://pastebin.org/38643
> >
> > b) Esteve?s code works on my pc but when I try to change it to make an
> > Exchange of type=?topic? (line 16) the program get stuck to this line. I
> > belive I there is an error.
> >
> uhm, never tried sorry
It looks like txAMQP lacks some error detection features and when something
erroneous happens, your program get stuck, since on error no callback is called,
but also no errback. :(
You can work around this by using a reactor.callLater() from twisted to be able
to cancel the timed out operation. :( That approach sucks, I know.
Could someone shed some light on the subject of proper error handling in txamqp?
                           PLEASE? any hint?

FAQ would be preferable.

> 
> e) What would be the main difference if using py-amqplib instead of txAMQP?
> > I would not benefit from an asynchronous framework?! i.e. I would have to
> > wait for the end of the execution of each commands like:
> > chan.exchange_declare(),chan.queue_bind() and more importantly a machine
> > waiting for a message would be stuck until it gets it instead of being able
> > to get it asynchronously?!
> >
> You would lose the benefit from deferred programming. Twisted (the framework
> above which txamqp is written http://www.twistedmatrix.com) allow you to
> write asynchronous calls to the amqp server. With pyamqplib you have to
> write your own loop to wait for the response, and the react, and then
> rewait, and so on.
> Twisted does all this for you, and a lot more.

It is still possible to use twisted with pyamqplib (as with any other syncronous
library) by moving all blocking calls out of reactor thread.
It is often preferable to put it into separate process (security & perfomance),
that will serve some RPC-like service, you may ever implement it in twisted.
But, as you can see, some effort is required.

> I suggest you to read the introduction to twisted. You can find it here
> http://twistedmatrix.com/projects/core/documentation/howto/async.html
> HTH
> Fabrizio

> _______________________________________________
> Mailing list: https://launchpad.net/~txamqp-user
> Post to     : txamqp-user@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~txamqp-user
> More help   : https://help.launchpad.net/ListHelp


-- 
Alexey.



Follow ups

References