Skip to content

Commit 316463c

Browse files
committed
vucm: device: clean-up init
1 parent ef1283b commit 316463c

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

enapter/vucm/device.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,7 @@ def is_device_command(func: DeviceCommandFunc) -> bool:
3434

3535

3636
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:
4338
self.__channel = channel
4439

4540
self.__tasks = {}
@@ -54,9 +49,9 @@ def __init__(
5449
if is_device_command(obj):
5550
self.__commands[name] = obj
5651

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+
)
6055

6156
self.log = Logger(channel=channel)
6257
self.alerts: Set[str] = set()

0 commit comments

Comments
 (0)