prefect.server.services.base
Functions
run_multiple_services
Classes
Service
Methods:
all_services
enabled
enabled_services
environment_variable_name
run_services
running
service_settings
start
stop
RunInEphemeralServers
A marker class for services that should run even when running an ephemeral server
Methods:
all_services
enabled
enabled_services
environment_variable_name
run_services
running
service_settings
start
stop
RunInWebservers
A marker class for services that should run when running a webserver
Methods:
all_services
enabled
enabled_services
environment_variable_name
run_services
running
service_settings
start
stop
LoopService
Loop services are relatively lightweight maintenance routines that need to run
periodically.
This class makes it straightforward to design and integrate them. Users only need to
define the run_once
coroutine to describe the behavior of the service on each
loop.
Methods:
all_services
enabled
enabled_services
environment_variable_name
run_once
LoopService().start(loops=1)
instead of LoopService().run_once()
, because this method will not invoke setup
and teardown methods properly.
run_services
running
service_settings
start
start
loops
time.
Args:
loops
: the number of loops to run before exiting.
start
loops
time. Pass loops=None to run forever.
Args:
loops
: the number of loops to run before exiting.
start
stop
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.