diff --git a/src/swf_typed/_common.py b/src/swf_typed/_common.py index 8d320eb..f9f3185 100644 --- a/src/swf_typed/_common.py +++ b/src/swf_typed/_common.py @@ -19,8 +19,6 @@ v: k for k, v in is_deprecated_by_registration_status.items() } -executor = concurrent.futures.ThreadPoolExecutor(max_workers=1) - class _Sentinel: """Not-provided value sentinel.""" @@ -123,6 +121,7 @@ def iter_() -> t.Generator[T, None, None]: response = future.result() yield from (model(d) for d in response.get(data_key) or []) + executor = concurrent.futures.ThreadPoolExecutor(max_workers=1) response = call() return iter_()