def __init__(self, name, uri, exchange, durable=False, auto_delete=False,
                 serializer=None, transport_options=None, ssl=False,
                 heartbeat=DEFAULT_HEARTBEAT, sysname=None, retry=None,
                 errback=None):
        """Set up a Dashi connection

        @param name: name of destination service queue used by consumers
        @param uri: broker URI (e.g. 'amqp://guest:guest@localhost:5672//')
        @param exchange: name of exchange to create and use
        @param durable: if True, destination service queue and exchange will be
        created as durable
        @param auto_delete: if True, destination service queue and exchange
        will be deleted when all consumers are gone
        @param serializer: specify a serializer for message encoding
        @param transport_options: custom parameter dict for the transport backend
        @param heartbeat: amqp heartbeat interval
        @param sysname: a prefix for exchanges and queues for namespacing
        @param retry: a RetryBackoff object, or None to use defaults
        @param errback: callback called within except block of connection failures
        """

        self._heartbeat_interval = heartbeat
        self._conn = Connection(uri, transport_options=transport_options,
                ssl=ssl, heartbeat=self._heartbeat_interval)
        if heartbeat:
            # create a connection template for pooled connections. These cannot
            # have heartbeat enabled.
            self._pool_conn = Connection(uri, transport_options=transport_options,
                    ssl=ssl)
        else:
            self._pool_conn = self._conn

        self._name = name
        self._sysname = sysname
        if self._sysname is not None:
            self._exchange_name = "%s.%s" % (self._sysname, exchange)
        else:
            self._exchange_name = exchange
        self._exchange = Exchange(name=self._exchange_name, type='direct',
                                  durable=durable, auto_delete=auto_delete)

        # visible attributes
        self.durable = durable
        self.auto_delete = auto_delete

        self._consumer = None

        self._linked_exceptions = {}

        self._serializer = serializer

        if retry is None:
            self.retry = RetryBackoff()
        else:
            self.retry = retry

        self._errback = errback
def __init__ ( self , name , uri , exchange , durable = False , auto_delete = False , serializer = None , transport_options = None , ssl = False , heartbeat = DEFAULT_HEARTBEAT , sysname = None , retry = None , errback = None ) : self . _heartbeat_interval = heartbeat self . _conn = Connection ( uri , transport_options = transport_options , ssl = ssl , heartbeat = self . _heartbeat_interval ) if heartbeat : self . _pool_conn = Connection ( uri , transport_options = transport_options , ssl = ssl ) else : self . _pool_conn = self . _conn self . _name = name self . _sysname = sysname if self . _sysname is not None : self . _exchange_name = "%s.%s" % ( self . _sysname , exchange ) else : self . _exchange_name = exchange self . _exchange = Exchange ( name = self . _exchange_name , type = 'direct' , durable = durable , auto_delete = auto_delete ) self . durable = durable self . auto_delete = auto_delete self . _consumer = None self . _linked_exceptions = { } self . _serializer = serializer if retry is None : self . retry = RetryBackoff ( ) else : self . retry = retry self . _errback = errback
Set up a Dashi connection

        @param name: name of destination service queue used by consumers
        @param uri: broker URI (e.g. 'amqp://guest:guest@localhost:5672//')
        @param exchange: name of exchange to create and use
        @param durable: if True, destination service queue and exchange will be
        created as durable
        @param auto_delete: if True, destination service queue and exchange
        will be deleted when all consumers are gone
        @param serializer: specify a serializer for message encoding
        @param transport_options: custom parameter dict for the transport backend
        @param heartbeat: amqp heartbeat interval
        @param sysname: a prefix for exchanges and queues for namespacing
        @param retry: a RetryBackoff object, or None to use defaults
        @param errback: callback called within except block of connection failures