prefect.server.events.services.triggers

Classes

ReactiveTriggers

Evaluates reactive automation triggers Methods:

all_services

all_services(cls) -> Sequence[type[Self]]
Get list of all service classes

enabled

enabled(cls) -> bool
Whether the service is enabled

enabled_services

enabled_services(cls) -> list[type[Self]]
Get list of enabled service classes

environment_variable_name

environment_variable_name(cls) -> str

run_services

run_services(cls) -> NoReturn
Run enabled services until cancelled.

running

running(cls) -> AsyncGenerator[None, None]
A context manager that runs enabled services on entry and stops them on exit.

service_settings

service_settings(cls) -> ServicesBaseSetting

service_settings

service_settings(cls) -> ServicesBaseSetting
The Prefect setting that controls whether the service is enabled

start

start(self) -> NoReturn

start

start(self) -> NoReturn
Start running the service, which may run indefinitely

stop

stop(self) -> None

stop

stop(self) -> None
Stop the service

ProactiveTriggers

Evaluates proactive automation triggers Methods:

run_once

run_once(self) -> None

run_once

run_once(self) -> None
Represents one loop of the service. Subclasses must override this method. To actually run the service once, call LoopService().start(loops=1) instead of LoopService().run_once(), because this method will not invoke setup and teardown methods properly.

service_settings

service_settings(cls) -> ServicesBaseSetting

start

start(self, loops: None = None) -> NoReturn
Run the service indefinitely.

stop

stop(self, block: bool = True) -> None
Gracefully stops a running LoopService and optionally blocks until the service stops. Args:
  • block: if True, blocks until the service is finished running. Otherwise it requests a stop and returns but the service may still be running a final loop.