|
15 | 15 |
|
16 | 16 | if TYPE_CHECKING:
|
17 | 17 | import datetime
|
18 |
| - from azure.core.credentials import TokenCredential, AzureSasCredential, AzureNamedKeyCredential |
| 18 | + from azure.core.credentials import ( |
| 19 | + TokenCredential, |
| 20 | + AzureSasCredential, |
| 21 | + AzureNamedKeyCredential, |
| 22 | + ) |
19 | 23 | from typing import ( # pylint: disable=ungrouped-imports
|
20 | 24 | Any,
|
21 | 25 | Union,
|
@@ -79,8 +83,9 @@ class EventHubConsumerClient(ClientBase):
|
79 | 83 | seconds. If the backoff_factor is 0.1, then the retry will sleep
|
80 | 84 | for [0.0s, 0.2s, 0.4s, ...] between retries. The default value is 0.8.
|
81 | 85 | :keyword float retry_backoff_max: The maximum back off time. Default value is 120 seconds (2 minutes).
|
82 |
| - :keyword retry_mode: Fixed or exponential delay between attempts, default is exponential. |
83 |
| - :paramtype retry_mode: ~azure.eventhub.RetryMode |
| 86 | + :keyword retry_mode: The delay behavior between retry attempts. Supported values are 'fixed' or 'exponential', |
| 87 | + where default is 'exponential'. |
| 88 | + :paramtype retry_mode: str |
84 | 89 | :keyword float idle_timeout: Timeout, in seconds, after which this client will close the underlying connection
|
85 | 90 | if there is no further activity. By default the value is None, meaning that the client will not shutdown due to
|
86 | 91 | inactivity unless initiated by the service.
|
@@ -151,10 +156,15 @@ def __init__(
|
151 | 156 | "partition_ownership_expiration_interval", None
|
152 | 157 | )
|
153 | 158 | if self._partition_ownership_expiration_interval is None:
|
154 |
| - self._partition_ownership_expiration_interval = 6 * self._load_balancing_interval |
| 159 | + self._partition_ownership_expiration_interval = ( |
| 160 | + 6 * self._load_balancing_interval |
| 161 | + ) |
155 | 162 | load_balancing_strategy = kwargs.pop("load_balancing_strategy", None)
|
156 |
| - self._load_balancing_strategy = LoadBalancingStrategy(load_balancing_strategy) if load_balancing_strategy \ |
| 163 | + self._load_balancing_strategy = ( |
| 164 | + LoadBalancingStrategy(load_balancing_strategy) |
| 165 | + if load_balancing_strategy |
157 | 166 | else LoadBalancingStrategy.GREEDY
|
| 167 | + ) |
158 | 168 | self._consumer_group = consumer_group
|
159 | 169 | network_tracing = kwargs.pop("logging_enable", False)
|
160 | 170 | super(EventHubConsumerClient, self).__init__(
|
@@ -235,8 +245,9 @@ def from_connection_string(cls, conn_str, consumer_group, **kwargs):
|
235 | 245 | seconds. If the backoff_factor is 0.1, then the retry will sleep
|
236 | 246 | for [0.0s, 0.2s, 0.4s, ...] between retries. The default value is 0.8.
|
237 | 247 | :keyword float retry_backoff_max: The maximum back off time. Default value is 120 seconds (2 minutes).
|
238 |
| - :keyword retry_mode: Fixed or exponential delay between attempts, default is exponential. |
239 |
| - :paramtype retry_mode: ~azure.eventhub.RetryMode |
| 248 | + :keyword retry_mode: The delay behavior between retry attempts. Supported values are 'fixed' or 'exponential', |
| 249 | + where default is 'exponential'. |
| 250 | + :paramtype retry_mode: str |
240 | 251 | :keyword float idle_timeout: Timeout, in seconds, after which this client will close the underlying connection
|
241 | 252 | if there is no furthur activity. By default the value is None, meaning that the client will not shutdown due
|
242 | 253 | to inactivity unless initiated by the service.
|
|
0 commit comments