AsyncSender Class

Implements the async API of a Sender.

Inheritance
AsyncSender

Constructor

AsyncSender(client, target, partition=None, send_timeout=60, keep_alive=None, auto_reconnect=True, loop=None)

Parameters

client
target
partition
default value: None
send_timeout
default value: 60
keep_alive
default value: None
auto_reconnect
default value: True
loop
default value: None

Methods

close_async

Close down the handler. If the handler has already closed, this will be a no op. An optional exception can be passed in to indicate that the handler was shutdown due to error.

has_started

Whether the handler has completed all start up processes such as establishing the connection, session, link and authentication, and is not ready to process messages. This function is now deprecated and will be removed in v2.0+.

open_async

Open the Sender using the supplied conneciton. If the handler has previously been redirected, the redirect context will be used to create a new handler before opening it.

reconnect_async

If the Receiver was disconnected from the service with a retryable error - attempt to reconnect.

send

Sends an event data and asynchronously waits until acknowledgement is received or operation times out.

wait_async

Wait until all transferred events have been sent.

close_async

Close down the handler. If the handler has already closed, this will be a no op. An optional exception can be passed in to indicate that the handler was shutdown due to error.

async close_async(exception=None)

Parameters

exception
Exception
default value: None

An optional exception if the handler is closing due to an error.

has_started

Whether the handler has completed all start up processes such as establishing the connection, session, link and authentication, and is not ready to process messages. This function is now deprecated and will be removed in v2.0+.

async has_started()

Return type

open_async

Open the Sender using the supplied conneciton. If the handler has previously been redirected, the redirect context will be used to create a new handler before opening it.

async open_async()

Parameters

connection
Required

The underlying client shared connection.

reconnect_async

If the Receiver was disconnected from the service with a retryable error - attempt to reconnect.

async reconnect_async()

send

Sends an event data and asynchronously waits until acknowledgement is received or operation times out.

async send(event_data)

Parameters

event_data
EventData
Required

The event to be sent.

Exceptions

azure.eventhub.common.EventHubError if the message fails tosend.

wait_async

Wait until all transferred events have been sent.

async wait_async()