Skip to content

Commit 70be5cd

Browse files
committed
Refactor docstrings for QueuedExecution and ActionQueue classes for consistency and clarity
1 parent 5dab17f commit 70be5cd

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

pyoverkiz/action_queue.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class QueuedExecution:
1515
"""Represents a queued action execution that will resolve to an exec_id when the batch executes."""
1616

1717
def __init__(self) -> None:
18+
"""Initialize the queued execution."""
1819
self._future: asyncio.Future[str] = asyncio.Future()
1920

2021
def set_result(self, exec_id: str) -> None:
@@ -33,8 +34,7 @@ def __await__(self):
3334

3435

3536
class ActionQueue:
36-
"""
37-
Batches multiple action executions into single API calls.
37+
"""Batches multiple action executions into single API calls.
3838
3939
When actions are added, they are held for a configurable delay period.
4040
If more actions arrive during this window, they are batched together.
@@ -53,8 +53,7 @@ def __init__(
5353
delay: float = 0.5,
5454
max_actions: int = 20,
5555
) -> None:
56-
"""
57-
Initialize the action queue.
56+
"""Initialize the action queue.
5857
5958
:param executor: Async function to execute batched actions
6059
:param delay: Seconds to wait before auto-flushing (default 0.5)
@@ -78,8 +77,7 @@ async def add(
7877
mode: CommandMode | None = None,
7978
label: str | None = None,
8079
) -> QueuedExecution:
81-
"""
82-
Add actions to the queue.
80+
"""Add actions to the queue.
8381
8482
:param actions: Actions to queue
8583
:param mode: Command mode (will flush if different from pending mode)
@@ -176,8 +174,7 @@ async def _flush_now(self) -> None:
176174
raise
177175

178176
async def flush(self) -> list[str]:
179-
"""
180-
Force flush all pending actions immediately.
177+
"""Force flush all pending actions immediately.
181178
182179
:return: List of exec_ids from flushed batches
183180
"""

0 commit comments

Comments
 (0)