databay.planners.schedule_planner¶
See also
Scheduling to learn more about scheduling in Databay.
BasePlannerfor the remaining interface of this planner.
Contents:
Raised when link interval is smaller than the Schedule refresh interval. |
|
Planner implementing scheduling using Schedule. Scheduling sets the |
-
exception
databay.planners.schedule_planner.ScheduleIntervalError[source]¶ databay.planners.schedule_planner.ScheduleIntervalError
Raised when link interval is smaller than the Schedule refresh interval.
Initialize self. See help(type(self)) for accurate signature.
Bases:
Exception
-
class
databay.planners.schedule_planner.SchedulePlanner(links: Union[Link, List[Link]] = None, threads: int = 30, refresh_interval: float = 1.0, ignore_exceptions: bool = False, catch_exceptions: bool = None, immediate_transfer: bool = True)[source]¶ databay.planners.schedule_planner.SchedulePlanner
Planner implementing scheduling using Schedule. Scheduling sets the
Schedule's Jobas links’ job.- Parameters
links (
Linkor list[Link]) – Links that should be added and scheduled.Default:Nonethreads (
int) – Number of threads to use.Default:30refresh_interval (
float) – Frequency at which this planner will scan over its links and attempt to update them if necessary. Note that adding links with intervals smaller than this value will raise aScheduleIntervalError.Default:1.0ignore_exceptions (
bool) – Whether exceptions should be ignored, or halt the planner.Default:Falseimmediate_transfer (
bool) – Whether planner should execute one transfer immediately upon starting.Default:True
Bases:
databay.base_planner.BasePlanner-
refresh_interval(self) → float[source]¶ property
Frequency at which this planner will scan over its links and attempt to update them if necessary. Note that adding links with interval smaller than this value will raise a
ScheduleIntervalError.- Returns
Refresh interval frequency.
- Return type
-
start(self)[source]¶ Start this planner. Links will start being scheduled based on their intervals after calling this method. Creates a new thread pool if one doesn’t already exist.
See Start and Shutdown to learn more about starting and shutdown.
-
shutdown(self, wait: bool = True)[source]¶ Stop this planner. Links will stop being scheduled after calling this method
See Start and Shutdown to learn more about starting and shutdown.
- Parameters
wait (bool) – Whether to wait until all currently executing jobs have finished.
Default:True