How to use the aiormq.spec function in aiormq

To help you get started, we’ve selected a few aiormq examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mosquito / aio-pika / aio_pika / transaction.py View on Github external
    async def select(self, timeout=None) -> aiormq.spec.Tx.SelectOk:
        result = await asyncio.wait_for(
            self.channel.tx_select(), timeout=timeout
        )

        self.state = TransactionStates.started
        return result
github mosquito / aio-pika / aio_pika / queue.py View on Github external
    async def declare(self, timeout: int=None) -> aiormq.spec.Queue.DeclareOk:
        """ Declare queue.

        :param timeout: execution timeout
        :param passive: Only check to see if the queue exists.
        :return: :class:`None`
        """

        log.debug("Declaring queue: %r", self)
        self.declaration_result = await asyncio.wait_for(
            self._channel.queue_declare(
                queue=self.name, durable=self.durable,
                exclusive=self.exclusive, auto_delete=self.auto_delete,
                arguments=self.arguments, passive=self.passive,
            ), timeout=timeout
        )  # type: aiormq.spec.Queue.DeclareOk