Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
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