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
The hostname of the AMQP service with which to establish a connection.
- sasl
- AMQPAuth
Authentication for the connection. If none is provided SASL Annoymous authentication will be used.
The name for the client, also known as the Container ID. If no name is provided, a random GUID will be used.
- idle_timeout
- int
Timeout in milliseconds after which the Connection will close if there is no further activity.
- remote_idle_timeout_empty_frame_send_ratio
- float
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
Whether to turn on network trace logs. If True, trace logs will be logged at INFO level. Default is False.
- encoding
- str
The encoding to use for parameters supplied as strings. Default is 'UTF-8'
- encoding
- loop
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
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
- auth
release_async
release_async()
sleep_async
Lock the connection for a given number of seconds.
async sleep_async(seconds)
Parameters
work_async
Perform a single Connection iteration asynchronously.
async work_async()
Attributes
loop
Feedback
Submit and view feedback for