Skip to content

Commit

Permalink
refactor(AutoData): optionally provide workers as kwarg to fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
kieran-mackle committed Oct 27, 2022
1 parent ed2a5be commit 7c41709
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion autotrader/autodata.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,8 @@ def fetch(
"""
func = getattr(self, f"_{self._feed}")
if isinstance(instrument, list):
with ThreadPoolExecutor() as executor:
max_workers = kwargs["workers"] if "workers" in kwargs else None
with ThreadPoolExecutor(max_workers=max_workers) as executor:
futures = {}
for i in instrument:
futures[i] = executor.submit(
Expand Down

0 comments on commit 7c41709

Please sign in to comment.