removes defaults in Task and PerInstanceTaskDescriptor

Removes overhead of keeping defaults the same everywhere.
This commit is contained in:
Mose Müller 2025-01-17 17:37:39 +01:00
parent 1b35dba64f
commit db559e8ada
2 changed files with 14 additions and 14 deletions

View File

@ -30,13 +30,13 @@ class PerInstanceTaskDescriptor(Generic[R]):
self,
func: Callable[[Any], Coroutine[None, None, R]]
| Callable[[], Coroutine[None, None, R]],
autostart: bool = False,
restart_on_failure: bool = False,
restart_sec: float = 1.0,
start_limit_interval_sec: float | None = None,
start_limit_burst: int = 3,
timeout_start_sec: float = 0.0,
exit_on_failure: bool = False,
autostart: bool,
restart_on_failure: bool,
restart_sec: float,
start_limit_interval_sec: float | None,
start_limit_burst: int,
timeout_start_sec: float,
exit_on_failure: bool,
) -> None:
self.__func = func
self.__autostart = autostart

View File

@ -92,13 +92,13 @@ class Task(pydase.data_service.data_service.DataService, Generic[R]):
self,
func: Callable[[], Coroutine[None, None, R | None]],
*,
autostart: bool = False,
restart_on_failure: bool = False,
restart_sec: float = 1.0,
start_limit_interval_sec: float | None = None,
start_limit_burst: int = 3,
timeout_start_sec: float = 0.0,
exit_on_failure: bool = False,
autostart: bool,
restart_on_failure: bool,
restart_sec: float,
start_limit_interval_sec: float | None,
start_limit_burst: int,
timeout_start_sec: float,
exit_on_failure: bool,
) -> None:
super().__init__()
self._autostart = autostart