@@ -29,19 +29,19 @@ def compile(self, *args, **kwargs):
2929
3030 async def search (self , compiled_regex , * args , ** kwargs ):
3131 self .ensure_compiled_regex (compiled_regex )
32- return await self .parent_helper .run_in_executor (compiled_regex .search , * args , ** kwargs )
32+ return await self .parent_helper .run_in_executor_cpu (compiled_regex .search , * args , ** kwargs )
3333
3434 async def match (self , compiled_regex , * args , ** kwargs ):
3535 self .ensure_compiled_regex (compiled_regex )
36- return await self .parent_helper .run_in_executor (compiled_regex .match , * args , ** kwargs )
36+ return await self .parent_helper .run_in_executor_cpu (compiled_regex .match , * args , ** kwargs )
3737
3838 async def sub (self , compiled_regex , * args , ** kwargs ):
3939 self .ensure_compiled_regex (compiled_regex )
40- return await self .parent_helper .run_in_executor (compiled_regex .sub , * args , ** kwargs )
40+ return await self .parent_helper .run_in_executor_cpu (compiled_regex .sub , * args , ** kwargs )
4141
4242 async def findall (self , compiled_regex , * args , ** kwargs ):
4343 self .ensure_compiled_regex (compiled_regex )
44- return await self .parent_helper .run_in_executor (compiled_regex .findall , * args , ** kwargs )
44+ return await self .parent_helper .run_in_executor_cpu (compiled_regex .findall , * args , ** kwargs )
4545
4646 async def findall_multi (self , compiled_regexes , * args , threads = 10 , ** kwargs ):
4747 """
@@ -55,7 +55,7 @@ async def findall_multi(self, compiled_regexes, *args, threads=10, **kwargs):
5555 tasks = {}
5656
5757 def new_task (regex_name , r ):
58- task = self .parent_helper .run_in_executor (r .findall , * args , ** kwargs )
58+ task = self .parent_helper .run_in_executor_cpu (r .findall , * args , ** kwargs )
5959 tasks [task ] = regex_name
6060
6161 compiled_regexes = dict (compiled_regexes )
@@ -77,15 +77,15 @@ def new_task(regex_name, r):
7777
7878 async def finditer (self , compiled_regex , * args , ** kwargs ):
7979 self .ensure_compiled_regex (compiled_regex )
80- return await self .parent_helper .run_in_executor (self ._finditer , compiled_regex , * args , ** kwargs )
80+ return await self .parent_helper .run_in_executor_cpu (self ._finditer , compiled_regex , * args , ** kwargs )
8181
8282 async def finditer_multi (self , compiled_regexes , * args , ** kwargs ):
8383 """
8484 Same as finditer() but with multiple regexes
8585 """
8686 for r in compiled_regexes :
8787 self .ensure_compiled_regex (r )
88- return await self .parent_helper .run_in_executor (self ._finditer_multi , compiled_regexes , * args , ** kwargs )
88+ return await self .parent_helper .run_in_executor_cpu (self ._finditer_multi , compiled_regexes , * args , ** kwargs )
8989
9090 def _finditer_multi (self , compiled_regexes , * args , ** kwargs ):
9191 matches = []
@@ -98,16 +98,16 @@ def _finditer(self, compiled_regex, *args, **kwargs):
9898 return list (compiled_regex .finditer (* args , ** kwargs ))
9999
100100 async def extract_params_html (self , * args , ** kwargs ):
101- return await self .parent_helper .run_in_executor (misc .extract_params_html , * args , ** kwargs )
101+ return await self .parent_helper .run_in_executor_cpu (misc .extract_params_html , * args , ** kwargs )
102102
103103 async def extract_emails (self , * args , ** kwargs ):
104- return await self .parent_helper .run_in_executor (misc .extract_emails , * args , ** kwargs )
104+ return await self .parent_helper .run_in_executor_cpu (misc .extract_emails , * args , ** kwargs )
105105
106106 async def search_dict_values (self , * args , ** kwargs ):
107107 def _search_dict_values (* _args , ** _kwargs ):
108108 return list (misc .search_dict_values (* _args , ** _kwargs ))
109109
110- return await self .parent_helper .run_in_executor (_search_dict_values , * args , ** kwargs )
110+ return await self .parent_helper .run_in_executor_cpu (_search_dict_values , * args , ** kwargs )
111111
112112 async def recursive_decode (self , * args , ** kwargs ):
113- return await self .parent_helper .run_in_executor (misc .recursive_decode , * args , ** kwargs )
113+ return await self .parent_helper .run_in_executor_cpu (misc .recursive_decode , * args , ** kwargs )
0 commit comments