buildgrid.server.scheduler.notifier module

class buildgrid.server.scheduler.notifier.NotificationChannel(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Enum

JOB_ASSIGNED = 'job_assigned'
JOB_UPDATED = 'job_updated'
class buildgrid.server.scheduler.notifier.Notifier(sql_provider: SqlProvider, channel: NotificationChannel, name: str, poll_interval: float = 1)

Bases: Generic[T]

start() None
stop() None
listener_count() int

Used for reporting job metrics about the scheduling.

begin(shutdown_requested: Event) None
notify(listener_name: str) None
subscription(listener_name: str) Iterator[Event]

Register a threading.Event object which is triggered each time the associated job_name updates its cancelled or stage status. After waiting for an event, the caller should immediately call event.clear() if they wish to re-use the event again, otherwise the event object will remain set.

class buildgrid.server.scheduler.notifier.OperationsNotifier(sql_provider: SqlProvider, poll_interval: float = 1.0)

Bases: Notifier[tuple[bool, int]]

class buildgrid.server.scheduler.notifier.BotNotifier(sql_provider: SqlProvider, poll_interval: float = 1.0)

Bases: Notifier[str]

listener_count_for_instance(instance_name: str) int