Skip to content
This repository was archived by the owner on Mar 31, 2026. It is now read-only.

Commit 26eb454

Browse files
committed
resolving comments
1 parent 16c0e5e commit 26eb454

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

‎google/cloud/storage/_experimental/asyncio/retry/base_strategy.py‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from typing import Any, Iterable
33

44
class _BaseResumptionStrategy(abc.ABC):
5-
"""Abstract base class defining the interface for a bidi stream strategy.
5+
"""Abstract base class defining the interface for a bidi stream resumption strategy.
66
77
This class defines the skeleton for a pluggable strategy that contains
88
all the service-specific logic for a given bidi operation (e.g., reads
@@ -19,7 +19,9 @@ def generate_requests(self, state: Any) -> Iterable[Any]:
1919
inspect the provided state object and generate the appropriate list of
2020
request protos to send to the server. For example, a read strategy
2121
would use this to implement "Smarter Resumption" by creating smaller
22-
`ReadRange` requests for partially downloaded ranges.
22+
`ReadRange` requests for partially downloaded ranges. For bidi-writes,
23+
it will set the `write_offset` field to the persisted size received
24+
from the server in the next request.
2325
2426
:type state: Any
2527
:param state: An object containing all the state needed for the
@@ -50,7 +52,9 @@ async def recover_state_on_failure(self, error: Exception, state: Any) -> None:
5052
responsible for performing any necessary actions to ensure the next
5153
retry attempt can succeed. For bidi reads, its primary role is to
5254
handle the `BidiReadObjectRedirectError` by extracting the
53-
`routing_token` and updating the state.
55+
`routing_token` and updating the state. For bidi writes, it will update
56+
the state to reflect any bytes that were successfully persisted before
57+
the failure.
5458
5559
:type error: :class:`Exception`
5660
:param error: The exception that was caught by the retry engine.

0 commit comments

Comments
 (0)