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, self,
func: Callable[[Any], Coroutine[None, None, R]] func: Callable[[Any], Coroutine[None, None, R]]
| Callable[[], Coroutine[None, None, R]], | Callable[[], Coroutine[None, None, R]],
autostart: bool = False, autostart: bool,
restart_on_failure: bool = False, restart_on_failure: bool,
restart_sec: float = 1.0, restart_sec: float,
start_limit_interval_sec: float | None = None, start_limit_interval_sec: float | None,
start_limit_burst: int = 3, start_limit_burst: int,
timeout_start_sec: float = 0.0, timeout_start_sec: float,
exit_on_failure: bool = False, exit_on_failure: bool,
) -> None: ) -> None:
self.__func = func self.__func = func
self.__autostart = autostart self.__autostart = autostart

View File

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