55class Thread: ...
66
77
8- class ParallelProcessing : ...
8+ class ConcurrentProcessing : ...
99```
1010
11- Documentation: https://thread.ngjx.org/docs/v1.1.1
11+ Documentation: https://thread.ngjx.org/docs/v2.0.0
1212"""
1313
1414import sys
@@ -230,18 +230,14 @@ def add_hook(self, hook: HookFunction[_Target_T]) -> None:
230230 """
231231 self .hooks .append (hook )
232232
233- def join (self , timeout : Optional [float ] = None ) -> bool :
233+ def join (self , timeout : Optional [float ] = None ) -> None :
234234 """
235235 Halts the current thread execution until a thread completes or exceeds the timeout
236236
237237 Parameters
238238 ----------
239239 :param timeout: The maximum time allowed to halt the thread
240240
241- Returns
242- -------
243- :returns bool: True if the thread is no-longer alive
244-
245241 Raises
246242 ------
247243 ThreadNotInitializedError: If the thread is not initialized
@@ -255,7 +251,6 @@ def join(self, timeout: Optional[float] = None) -> bool:
255251
256252 super ().join (timeout )
257253 self ._handle_exceptions ()
258- return not self .is_alive ()
259254
260255 def get_return_value (self ) -> _Target_T :
261256 """
@@ -341,9 +336,9 @@ def __init__(self, thread: Thread, progress: float = 0) -> None:
341336 self .progress = progress
342337
343338
344- class ParallelProcessing (Generic [_Target_P , _Target_T , _Dataset_T ]):
339+ class ConcurrentProcessing (Generic [_Target_P , _Target_T , _Dataset_T ]):
345340 """
346- Multi-Threaded Parallel Processing
341+ Concurrent Processing
347342 ---------------------------------------
348343
349344 Type-Safe and provides more functionality on top
@@ -378,7 +373,8 @@ def __init__(
378373 _get_value : Optional [Callable [[LengthandGetLike_T , int ], _Dataset_T ]] = None ,
379374 _length : Optional [Union [int , Callable [[Any ], int ]]] = None ,
380375 ** overflow_kwargs : Overflow_In ,
381- ) -> None : ...
376+ ) -> None :
377+ ...
382378
383379 # Has __len__, require _get_value to be set
384380 @overload
@@ -391,7 +387,8 @@ def __init__(
391387 _get_value : Callable [[LengthLike_T , int ], _Dataset_T ],
392388 _length : Optional [Union [int , Callable [[Any ], int ]]] = None ,
393389 ** overflow_kwargs : Overflow_In ,
394- ) -> None : ...
390+ ) -> None :
391+ ...
395392
396393 # Has __getitem__, require _length to be set
397394 @overload
@@ -404,7 +401,8 @@ def __init__(
404401 _get_value : Optional [Callable [[GetLike_T , int ], _Dataset_T ]] = None ,
405402 _length : Union [int , Callable [[GetLike_T ], int ]],
406403 ** overflow_kwargs : Overflow_In ,
407- ) -> None : ...
404+ ) -> None :
405+ ...
408406
409407 # Does not support __getitem__ and __len__
410408 @overload
@@ -417,7 +415,8 @@ def __init__(
417415 _get_value : Callable [[Any , int ], _Dataset_T ],
418416 _length : Union [int , Callable [[Any ], int ]],
419417 ** overflow_kwargs : Overflow_In ,
420- ) -> None : ...
418+ ) -> None :
419+ ...
421420
422421 def __init__ (
423422 self ,
@@ -442,10 +441,10 @@ def __init__(
442441 ** overflow_kwargs : Overflow_In ,
443442 ) -> None :
444443 """
445- Initializes a new Multi-Threaded Pool \n
444+ Initializes a new Concurrent Process \n
446445 Best for data processing
447446
448- Splits a dataset as evenly as it can among the threads and run them in parallel
447+ Splits a dataset as evenly as it can among the threads and run them concurrently
449448
450449 Parameters
451450 ----------
@@ -598,14 +597,10 @@ def get_return_values(self) -> List[_Dataset_T]:
598597 results += entry .thread .result
599598 return results
600599
601- def join (self ) -> bool :
600+ def join (self ) -> None :
602601 """
603602 Halts the current thread execution until a thread completes or exceeds the timeout
604603
605- Returns
606- -------
607- :returns bool: True if the thread is no-longer alive
608-
609604 Raises
610605 ------
611606 ThreadNotInitializedError: If the thread is not initialized
@@ -619,7 +614,6 @@ def join(self) -> bool:
619614
620615 for entry in self ._threads :
621616 entry .thread .join ()
622- return True
623617
624618 def kill (self ) -> None :
625619 """
0 commit comments