]> git.phdru.name Git - bookmarks_db.git/commitdiff
Refactor(Robots): Split `robot_multirequests` into `cf_multiprocess`
authorOleg Broytman <phd@phdru.name>
Mon, 9 Sep 2024 20:07:24 +0000 (23:07 +0300)
committerOleg Broytman <phd@phdru.name>
Mon, 9 Sep 2024 20:26:04 +0000 (23:26 +0300)
Robots/bkmk_rmultirequests.py
Robots/concurrent_futures.py

index 39daf9c381fca93111cf78bb80356c8da9e6cd9b..3a52b44fdfd9899cfa75984784e34665a4eaec0e 100644 (file)
@@ -12,17 +12,11 @@ __license__ = "GNU GPL"
 __all__ = ['robot_multirequests']
 
 
-import concurrent.futures
-
-from Robots.concurrent_futures import concurrent_futures
+from Robots.concurrent_futures import cf_multiprocess
 from robots import import_robot, set_params, robot_params
 
 
-class robot_multirequests(concurrent_futures):
-    def __init__(self, *args, **kw):
-        self.concurrent_class = concurrent.futures.ProcessPoolExecutor
-        concurrent_futures.__init__(self, *args, **kw)
-
+class robot_multirequests(cf_multiprocess):
     def check_bkmk_task(self):
         return check_bookmark_subproc
 
index 7e4a165d80dec7c5dca8b12a91e2a41ce87f088e..11dd0347ba1d949e8fda08d0daff13e78ff47f75 100644 (file)
@@ -77,3 +77,9 @@ class concurrent_futures(multi_mixin, robot_base):
     def stop(self):
         super(concurrent_futures, self).stop()
         self.executor.shutdown(wait=True)
+
+
+class cf_multiprocess(concurrent_futures):
+    def __init__(self, *args, **kw):
+        self.concurrent_class = concurrent.futures.ProcessPoolExecutor
+        concurrent_futures.__init__(self, *args, **kw)