@@ -69,25 +69,25 @@ async def __anext__(self) -> T:
6969 Raises:
7070 StopAsyncIteration: if the underlying channel is closed.
7171 """
72- await self ._ready ()
73- return self ._get ()
72+ await self .ready ()
73+ return self .consume ()
7474
7575 @abstractmethod
76- async def _ready (self ) -> None :
76+ async def ready (self ) -> None :
7777 """Wait until the receiver is ready with a value.
7878
79- Once a call to `_ready ` has finished, the value should be read with a call to
80- `_get ()`.
79+ Once a call to `ready() ` has finished, the value should be read with a call to
80+ `consume ()`.
8181
8282 Raises:
8383 StopAsyncIteration: if the underlying channel is closed.
8484 """
8585
8686 @abstractmethod
87- def _get (self ) -> T :
88- """Return the latest value once `_ready ` is complete.
87+ def consume (self ) -> T :
88+ """Return the latest value once `ready() ` is complete.
8989
90- `_ready ()` must be called before each call to `_get ()`.
90+ `ready ()` must be called before each call to `consume ()`.
9191
9292 Returns:
9393 The next value received.
@@ -193,14 +193,14 @@ def __init__(self, recv: Receiver[T], transform: Callable[[T], U]) -> None:
193193 self ._recv = recv
194194 self ._transform = transform
195195
196- async def _ready (self ) -> None :
196+ async def ready (self ) -> None :
197197 """Wait until the receiver is ready with a value."""
198- await self ._recv ._ready () # pylint: disable=protected-access
198+ await self ._recv .ready () # pylint: disable=protected-access
199199
200- def _get (self ) -> U :
201- """Return a transformed value once `_ready ()` is complete.
200+ def consume (self ) -> U :
201+ """Return a transformed value once `ready ()` is complete.
202202
203203 Returns:
204204 The next value that was received.
205205 """
206- return self ._transform (self ._recv ._get ()) # pylint: disable=protected-access
206+ return self ._transform (self ._recv .consume ()) # pylint: disable=protected-access
0 commit comments