Skip to content

Conversation

@HansVRP
Copy link
Contributor

@HansVRP HansVRP commented Dec 11, 2025

No description provided.

@HansVRP HansVRP requested a review from soxofaan December 11, 2025 14:20
Copy link
Member

@soxofaan soxofaan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some quick notes

@HansVRP HansVRP requested a review from soxofaan December 16, 2025 11:55
Copy link
Member

@soxofaan soxofaan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some more quick notes I managed to squeeze in

"""

def __init__(self, max_workers: int = 2):
def __init__(self, max_workers: int = 1, name: str = 'default'):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not necessary to give a a name here right? or how would that be used?

@soxofaan
Copy link
Member

soxofaan commented Jan 5, 2026

image

I think there is something wrong with this feature branch or pull request (rebase gone wrong?)

@HansVRP
Copy link
Contributor Author

HansVRP commented Jan 6, 2026

oh that is odd, will indeed cherrypick and redo the rebase

@HansVRP HansVRP force-pushed the issue816_threadeddownload branch from 3234f4f to 597997f Compare January 6, 2026 10:35
@HansVRP HansVRP force-pushed the issue816_threadeddownload branch from 597997f to c999d1f Compare January 6, 2026 11:11
@HansVRP
Copy link
Contributor Author

HansVRP commented Jan 6, 2026

@soxofaan apologies for not noticing myself, branch is back in order

@HansVRP HansVRP requested a review from soxofaan January 15, 2026 13:32
@HansVRP
Copy link
Contributor Author

HansVRP commented Jan 21, 2026

good to merge @soxofaan ?

def __init__(self, max_workers: int = 1, name: str = 'default'):
self._executor = concurrent.futures.ThreadPoolExecutor(max_workers=max_workers)
self._future_task_pairs: List[Tuple[concurrent.futures.Future, Task]] = []
self._name = name
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose of this name? I don't see it being used somewhere

:param max_workers:
Maximum number of concurrent threads to use for execution.
Defaults to 2.
Defaults to 1.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason to change this default?


self._future_task_pairs = to_keep
return results, len(to_keep)
return results
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there an important reason to remove len(to_keep) here?

Also note that return type annotation and documentation are not updated yet here


def number_pending_tasks(self) -> int:
"""Return the number of tasks that are still pending (not completed)."""
return len(self._future_task_pairs)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that separating number_pending_tasks from process_futures might be risky/misleading as number_pending_tasks only makes sense if process_futures has run recently enough, otherwise it will return possibly outdated information.

results = pool.process_futures(timeout)
all_results.extend(results)

return all_results
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return type does not correspond with type annotation here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants