How to use the aiormq.connect 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 / aiormq / tests / test_connection.py View on Github external
async def test_conncetion_reject(event_loop):
    with pytest.raises(ConnectionError):
        await aiormq.connect(
            "amqp://guest:guest@127.0.0.1:59999/", loop=event_loop
        )

    connection = aiormq.Connection(
        "amqp://guest:guest@127.0.0.1:59999/", loop=event_loop
    )

    with pytest.raises(ConnectionError):
        await event_loop.create_task(connection.connect())
github mosquito / aio-pika / aio_pika / connection.py View on Github external
async def _make_connection(self, **kwargs) -> aiormq.Connection:
        connection = await aiormq.connect(self.url, **kwargs)
        connection.closing.add_done_callback(
            partial(self._on_connection_close, self.connection)
        )
        return connection