databay.planners.aps_planner

See also

  • Scheduling to learn more about scheduling in Databay.

  • BasePlanner for the remaining interface of this planner.

Contents:

ApsPlanner

Planner implementing scheduling using the Advanced Python Scheduler. Scheduling sets the APS Job as links’ job.

APSPlanner

Planner implementing scheduling using the Advanced Python Scheduler. Scheduling sets the APS Job as links’ job.

class databay.planners.aps_planner.ApsPlanner(links: Union[Link, List[Link]] = None, threads: int = 30, executors_override: dict = None, job_defaults_override: dict = None, ignore_exceptions: bool = False, catch_exceptions: bool = None, immediate_transfer: bool = True)[source]

databay.planners.aps_planner.ApsPlanner

Planner implementing scheduling using the Advanced Python Scheduler. Scheduling sets the APS Job as links’ job.

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

    Default:
    None

  • threads (int) – Number of threads available for job execution. Each link will be run on a separate thread job.

    Default:
    30

  • executors_override (dict) – Overrides for executors option of APS configuration

    Default:
    None

  • job_defaults_override (dict) – Overrides for job_defaults option of APS configuration

    Default:
    None

  • 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

start(self)[source]

Start this planner. Calls APS Scheduler.start()

See Start and Shutdown to learn more about starting and shutdown.

pause(self)[source]

Pause this planner. Calls APScheduler.pause()

resume(self)[source]

Resume this planner. Calls APScheduler.resume()

shutdown(self, wait: bool = True)[source]

Shutdown this planner. Calls APScheduler.shutdown()

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

purge(self)[source]

Unschedule and clear all links. It can be used while planner is running. APS automatically removes jobs, so we only clear the links.

running(self)[source]

property

Whether this planner is currently running. Changed by calls to start and shutdown.

Returns

State of this planner

Return type

bool

class databay.planners.aps_planner.APSPlanner(*args, **kwargs)[source]

databay.planners.aps_planner.APSPlanner

Planner implementing scheduling using the Advanced Python Scheduler. Scheduling sets the APS Job as links’ job.

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

    Default:
    None

  • threads (int) – Number of threads available for job execution. Each link will be run on a separate thread job.

    Default:
    30

  • executors_override (dict) – Overrides for executors option of APS configuration

    Default:
    None

  • job_defaults_override (dict) – Overrides for job_defaults option of APS configuration

    Default:
    None

  • 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.planners.aps_planner.ApsPlanner