databay.planners.schedule_planner

See also

  • Scheduling to learn more about scheduling in Databay.

  • BasePlanner for the remaining interface of this planner.

Contents:

ScheduleIntervalError

Raised when link interval is smaller than the Schedule refresh interval.

SchedulePlanner

Planner implementing scheduling using Schedule. Scheduling sets the Schedule's Job as links’ job.

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 Job as links’ job.

Parameters
  • links (Link or list[Link]) – Links that should be added and scheduled.

    Default:
    None

  • threads (int) – Number of threads to use.

    Default:
    30

  • refresh_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 a ScheduleIntervalError.

    Default:
    1.0

  • ignore_exceptions (bool) – Whether exceptions should be ignored, or halt the planner.

    Default:
    False

  • immediate_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

float

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

running(self)[source]

property

Whether this planner is currently running. If there are links transferring this may be set before all transfers are complete. Changed by calls to start and shutdown.

Returns

State of this planner

Return type

bool