ConnectionAsync Class

An Asynchronous AMQP Connection. A single Connection can have multiple Sessions, and can be shared between multiple Clients.

Inheritance
ConnectionAsync

Constructor

ConnectionAsync(hostname, sasl, container_id=False, max_frame_size=None, channel_max=None, idle_timeout=None, properties=None, remote_idle_timeout_empty_frame_send_ratio=None, error_policy=None, debug=False, encoding='UTF-8', loop=None)

Parameters

hostname
bytes or str
Required

The hostname of the AMQP service with which to establish a connection.

sasl
AMQPAuth
Required

Authentication for the connection. If none is provided SASL Annoymous authentication will be used.

container_id
str or bytes
default value: False

The name for the client, also known as the Container ID. If no name is provided, a random GUID will be used.

max_frame_size
int
default value: None

Maximum AMQP frame size. Default is 63488 bytes.

channel_max
int
default value: None

Maximum number of Session channels in the Connection.

idle_timeout
int
default value: None

Timeout in milliseconds after which the Connection will close if there is no further activity.

properties
dict
default value: None

Connection properties.

remote_idle_timeout_empty_frame_send_ratio
float
default value: None

Ratio of empty frames to idle time for Connections with no activity. Value must be between 0.0 and 1.0 inclusive. Default is 0.5.

debug
bool
default value: None

Whether to turn on network trace logs. If True, trace logs will be logged at INFO level. Default is False.

encoding
str
default value: False

The encoding to use for parameters supplied as strings. Default is 'UTF-8'

encoding
default value: UTF-8
loop
default value: None

Variables

max_frame_size
int

Maximum AMQP frame size. Default is 63488 bytes.

channel_max
int

Maximum number of Session channels in the Connection.

idle_timeout
int

Timeout in milliseconds after which the Connection will close if there is no further activity.

properties
dict

Connection properties.

Methods

destroy_async

Close the connection asynchronously, and close any associated CBS authentication session.

lock_async
redirect_async

Redirect the connection to an alternative endpoint. :param redirect: The Link DETACH redirect details. :type redirect: ~uamqp.errors.LinkRedirect :param auth: Authentication credentials to the redirected endpoint. :type auth: ~uamqp.authentication.common.AMQPAuth

release_async
sleep_async

Lock the connection for a given number of seconds.

work_async

Perform a single Connection iteration asynchronously.

destroy_async

Close the connection asynchronously, and close any associated CBS authentication session.

async destroy_async()

lock_async

async lock_async(timeout=3.0)

Parameters

timeout
default value: 3.0

redirect_async

Redirect the connection to an alternative endpoint. :param redirect: The Link DETACH redirect details. :type redirect: ~uamqp.errors.LinkRedirect :param auth: Authentication credentials to the redirected endpoint. :type auth: ~uamqp.authentication.common.AMQPAuth

async redirect_async(redirect_error, auth)

Parameters

redirect_error
Required
auth
Required

release_async

release_async()

sleep_async

Lock the connection for a given number of seconds.

async sleep_async(seconds)

Parameters

seconds
int
Required

Length of time to lock the connection.

work_async

Perform a single Connection iteration asynchronously.

async work_async()

Attributes

loop