Skip to content

Instantly share code, notes, and snippets.

@hmax
Created May 14, 2010 01:44
Show Gist options
  • Save hmax/400710 to your computer and use it in GitHub Desktop.
Save hmax/400710 to your computer and use it in GitHub Desktop.
def prepareExchanges(self, conn):
log.msg("preparing")
self._chan = conn.channel(1)
self._chan = self._chan.addCallback(lambda c: c.channel_open())
res = self._chan.addCallback(lambda c: c.exchange_declare(exchange=self._exchange, type="direct", durable=True, auto_delete=False))
return res
deferred = client.authenticate(self.user, self.password)
self._conn = deferred
deferred = deferred.addCallback(self.prepareExchanges)
deferred = deferred.addCallback(self.associateConnectionWithBots)
return deferred
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment