Hi,

On Tue, Oct 12, 2010 at 4:15 AM, Jithu Menon <jithu.me...@skype.net> wrote:
> Hi,
>  I'm very new to txamqp and was wondering if there was an obvious way
> to subscribe to a queue that I simply couldn't see. Almost all examples
> for getting messages from a queue I've seen involves calling queue.get() 
> (i.e. We are polling).

you're not polling, you're waiting for I/O.
yield'ing queue.get in fact means "register a deferred and fire it when there's
some data"... so is already a callback :)

if you do: d = queue.get() and then d.addCallback(fetchdata), the fetchdata
function will be called when some data is ready.
By using yield and the inlineCallbacks decorator you're doing the same
thing, but without creating a callBack chain...

regards,
matteo

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

Reply via email to