Commits
Click on a commit to change the comparison rangeIntroduces a `Service` base class to cover loop and other services
We have two kinds of background services in the Prefect server: loop
services that run a task periodically, and consumer services that react
to messages on a message bus. I'd like to unify their treatment in a
series of PRs with a few goals:
- That we can run the consumer-style services along with the loop
services in the background service process we start with `prefect
server services`
- That we can either opt-in or opt-out of running services in either
the API or the background services process
- That we can take the next step in refactoring services following the
really cool discovery logic that @zzstoatzz added to the CLI:
- A service knows which setting enables itself
- There is one routine for finding the relevant services to start or
stop for a given process
- The starting and graceful stopping logic is consolidated to one
place
This will open our options when scaling out Prefect, like running
multiple Prefect server replicas with either the in-process or
out-of-process message brokers, and running multiple services replicas
with different subsets of services.
This PR is just the first step along that path, to introduce a base
class and also to make sure that we're correctly running all the
consumers in web-only processes (this is important for correctness with
the in-memory broker--every process that could emit events will need to
run these consumers when using the in-memory broker).8 months ago
by chrisguidry Update loop_service.py8 months ago
by chrisguidry Merge branch 'main' into base-services8 months ago
by chrisguidry