FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

minor changes · googleapis/python-storage@9b84197 · GitHub

This repository was archived by the owner on Mar 31, 2026. It is now read-only.
/ python-storage Public archive

Commit 9b84197

Browse files
committed
minor changes
1 parent ace6194 commit 9b84197

1 file changed

Lines changed: 5 additions & 11 deletions

File tree

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

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import abc
2-
from typing import Any
2+
from typing import Any, Iterable
33

44
class _BaseResumptionStrategy(abc.ABC):
55
"""Abstract base class defining the interface for a bidi stream strategy.
@@ -12,7 +12,7 @@ class _BaseResumptionStrategy(abc.ABC):
1212
"""
1313

1414
@abc.abstractmethod
15-
def generate_requests(self, state: Any):
15+
def generate_requests(self, state: Any) -> Iterable[Any]:
1616
"""Generates the next batch of requests based on the current state.
1717
1818
This method is called at the beginning of each retry attempt. It should
@@ -29,25 +29,21 @@ def generate_requests(self, state: Any):
2929
pass
3030

3131
@abc.abstractmethod
32-
def update_state_from_response(self, state: Any):
32+
def update_state_from_response(self, state: Any) -> None:
3333
"""Updates the state based on a successful server response.
3434
3535
This method is called for every message received from the server. It is
3636
responsible for processing the response and updating the shared state
37-
object. For bidi reads, this is where data integrity checks should be
38-
performed and the `bytes_written` for the corresponding range should be
39-
updated.
37+
object.
4038
4139
:type state: Any
4240
:param state: The shared state object for the operation, which will be
4341
mutated by this method.
44-
45-
:rtype: None
4642
"""
4743
pass
4844

4945
@abc.abstractmethod
50-
async def recover_state_on_failure(self, error: Exception, state: Any):
46+
async def recover_state_on_failure(self, error: Exception, state: Any) -> None:
5147
"""Prepares the state for the next retry attempt after a failure.
5248
5349
This method is called when a retriable gRPC error occurs. It is
@@ -61,7 +57,5 @@ async def recover_state_on_failure(self, error: Exception, state: Any):
6157
6258
:type state: Any
6359
:param state: The shared state object for the operation.
64-
65-
:rtype: None
6660
"""
6761
pass

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL