From: Tom Christie Date: Fri, 29 Nov 2019 11:45:40 +0000 (+0000) Subject: Drop `iterate_in_threadpool` and `iterate` (#564) X-Git-Tag: 0.9.0~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b1393ec2f1c23bec061d77523b121eba42087c86;p=thirdparty%2Fhttpx.git Drop `iterate_in_threadpool` and `iterate` (#564) * Drop iterate_in_threadpool * Drop iterate from concurrency backends --- diff --git a/httpx/concurrency/base.py b/httpx/concurrency/base.py index a8d44f07..172e7c2d 100644 --- a/httpx/concurrency/base.py +++ b/httpx/concurrency/base.py @@ -129,34 +129,11 @@ class ConcurrencyBackend: ) -> typing.Any: raise NotImplementedError() # pragma: no cover - async def iterate_in_threadpool(self, iterator): # type: ignore - class IterationComplete(Exception): - pass - - def next_wrapper(iterator): # type: ignore - try: - return next(iterator) - except StopIteration: - raise IterationComplete() - - while True: - try: - yield await self.run_in_threadpool(next_wrapper, iterator) - except IterationComplete: - break - def run( self, coroutine: typing.Callable, *args: typing.Any, **kwargs: typing.Any ) -> typing.Any: raise NotImplementedError() # pragma: no cover - def iterate(self, async_iterator): # type: ignore - while True: - try: - yield self.run(async_iterator.__anext__) - except StopAsyncIteration: - break - def create_event(self) -> BaseEvent: raise NotImplementedError() # pragma: no cover