From d92169475c8b5e2c1f809200b5da4cffe4d8458d Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Thu, 5 Sep 2024 17:03:04 +0300 Subject: [PATCH] Feat(bkmk_rmultirequests): Fix `concurrent_class` to `ProcessPoolExecutor` --- Robots/bkmk_rmultirequests.py | 8 ++------ doc/ANNOUNCE | 4 ++++ doc/ChangeLog | 4 ++++ 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Robots/bkmk_rmultirequests.py b/Robots/bkmk_rmultirequests.py index 97bc34e..fc66f4e 100644 --- a/Robots/bkmk_rmultirequests.py +++ b/Robots/bkmk_rmultirequests.py @@ -25,18 +25,14 @@ cpu_count = os.cpu_count() class robot_multirequests(multi_mixin, robot_base): - concurrent_class = concurrent.futures.ProcessPoolExecutor # or ThreadPoolExecutor # noqa: E501 line too long - # We're I/O-bound, not CPU-bound max_urls = 2*cpu_count if cpu_count else 10 def __init__(self, *args, **kw): - concurrent_class = getattr(concurrent.futures, self.concurrent_class) \ - if isinstance(self.concurrent_class, str) \ - else self.concurrent_class - self.concurrent_class_name = concurrent_class.__name__ + concurrent_class = concurrent.futures.ProcessPoolExecutor multi_mixin.__init__(self, *args, **kw) robot_base.__init__(self, *args, **kw) + self.concurrent_class_name = concurrent_class.__name__ self.executor = concurrent_class(max_workers=self.max_urls) def version_str(self): diff --git a/doc/ANNOUNCE b/doc/ANNOUNCE index 000bd95..8d6e40e 100644 --- a/doc/ANNOUNCE +++ b/doc/ANNOUNCE @@ -7,6 +7,10 @@ bookmarks.html. WHAT'S NEW +Version 6.1.0 (2024-??-??) + + Make bkmk_rmultirequests always multiprocess. + Version 6.0.0 (2024-08-19) Robot based on aiohttp, processes multiple URLs in parallel. diff --git a/doc/ChangeLog b/doc/ChangeLog index d7832a7..bb90fc8 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +Version 6.1.0 (2024-??-??) + + Make bkmk_rmultirequests always multiprocess. + Version 6.0.0 (2024-08-19) Robot based on aiohttp, processes multiple URLs in parallel. -- 2.39.5