File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -34,12 +34,7 @@ def is_device_command(func: DeviceCommandFunc) -> bool:
34
34
35
35
36
36
class Device (enapter .async_ .Routine ):
37
- def __init__ (
38
- self ,
39
- channel ,
40
- cmd_prefix = "cmd_" ,
41
- thread_pool_executor = None ,
42
- ) -> None :
37
+ def __init__ (self , channel , thread_pool_workers : int = 1 ) -> None :
43
38
self .__channel = channel
44
39
45
40
self .__tasks = {}
@@ -54,9 +49,9 @@ def __init__(
54
49
if is_device_command (obj ):
55
50
self .__commands [name ] = obj
56
51
57
- if thread_pool_executor is None :
58
- thread_pool_executor = concurrent . futures . ThreadPoolExecutor ( max_workers = 1 )
59
- self . __thread_pool_executor = thread_pool_executor
52
+ self . __thread_pool_executor = concurrent . futures . ThreadPoolExecutor (
53
+ max_workers = thread_pool_workers
54
+ )
60
55
61
56
self .log = Logger (channel = channel )
62
57
self .alerts : Set [str ] = set ()
You can’t perform that action at this time.
0 commit comments