Skip to content

Commit 32a2eac

Browse files
authored
remove duplicate __init__ docstring in AutoLockRenewer (Azure#40562)
The class- and __init__-level docstrings for AutoLockRenewer both contained identical parameter descriptions, causing eight parameter tables to appear instead of the intended four. This commit removes the __init__ docstring block and centralizes all documentation in the class-level docstring. - Delete duplicate docstring in __init__. - Retain summary and Attributes section in class-level docstring. - Ensure Sphinx/AutoAPI generates only the correct four parameters. This prevents erroneous “required” flags on defaulted parameters and keeps the API reference clean and accurate.
1 parent 7164cde commit 32a2eac

File tree

1 file changed

+2
-18
lines changed

1 file changed

+2
-18
lines changed

sdk/servicebus/azure-servicebus/azure/servicebus/_common/auto_lock_renewer.py

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131

3232
class AutoLockRenewer(object): # pylint:disable=too-many-instance-attributes
3333
"""Auto renew locks for messages and sessions using a background thread pool.
34+
When handling multiple messages or sessions concurrently,
35+
set `max_workers` high or pass a ThreadPoolExecutor with sufficient `max_workers`.
3436
3537
:param max_lock_renewal_duration: A time in seconds that locks registered to this renewer
3638
should be maintained for. Default value is 300 (5 minutes).
@@ -71,24 +73,6 @@ def __init__(
7173
executor: Optional[ThreadPoolExecutor] = None,
7274
max_workers: Optional[int] = None,
7375
) -> None:
74-
"""Auto renew locks for messages and sessions using a background thread pool. It is recommended
75-
setting max_worker to a large number or passing ThreadPoolExecutor of large max_workers number when
76-
AutoLockRenewer is supposed to deal with multiple messages or sessions simultaneously.
77-
78-
:param max_lock_renewal_duration: A time in seconds that locks registered to this renewer
79-
should be maintained for. Default value is 300 (5 minutes).
80-
:type max_lock_renewal_duration: float
81-
:param on_lock_renew_failure: A callback may be specified to be called when the lock is lost on the renewable
82-
that is being registered. Default value is None (no callback).
83-
:type on_lock_renew_failure: Optional[LockRenewFailureCallback]
84-
:param executor: A user-specified thread pool. This cannot be combined with
85-
setting `max_workers`.
86-
:type executor: Optional[~concurrent.futures.ThreadPoolExecutor]
87-
:param max_workers: Specify the maximum workers in the thread pool. If not
88-
specified the number used will be derived from the core count of the environment.
89-
This cannot be combined with `executor`.
90-
:type max_workers: Optional[int]
91-
"""
9276
self._executor = executor or ThreadPoolExecutor(max_workers=max_workers)
9377
# None indicates it's unknown whether the provided executor has max workers > 1
9478
self._is_max_workers_greater_than_one = None if executor else (max_workers is None or max_workers > 1)

0 commit comments

Comments
 (0)