PollingRule#

class lsst.ts.watcher.PollingRule(config, name, remote_info_list, log=None)#

Bases: BaseRule

Base class for watcher rules that poll for data.

Regularly call update_alarm_severity with no arguments, at the interval specified by config.poll_interval.

Parameters:
  • config (types.SimpleNamespace) – Rule configuration, as validated by the schema. Must include a float field named “poll_interval” set to the polling interval in seconds.

  • name (str) – Name of alarm. This must be unique among all alarms and should be of the form system.[subsystem….]_name so that groups of related alarms can be acknowledged.

  • remote_info_list (list [RemoteInfo]) – Information about the remotes used by this rule.

  • log (logging.Logger, optional) – Parent logger.

BaseRule attributes

All attributes from BaseRule, plus:

poll_start_tai#

The time (TAI, unix seconds) at which polling began.

Type:

float

poll_loop_task#

Task that runs the polling loop.

Type:

asyncio.Future

Methods Summary

poll_loop()

start()

Start any background tasks, such as a polling loop.

stop()

Stop all background tasks.

Methods Documentation

async poll_loop()#
start()#

Start any background tasks, such as a polling loop.

This is called when the watcher goes into the enabled state.

Notes

Do not assume that start is called before stop; the order depends on the initial state of the Watcher.

Immediate subclasses need not call super().start()

stop()#

Stop all background tasks.

This is called when the watcher goes out of the enabled state, and must stop any tasks that might trigger an alarm state change.

Notes

Do not assume that start is called before stop; the order depends on the initial state of the Watcher.

This base implementation does nothing, so immediate subclasses need not call super().stop().