prefect.server.events.stream

Functions

subscribed

subscribed(filter: EventFilter) -> AsyncGenerator['Queue[ReceivedEvent]', None]

events

events(filter: EventFilter) -> AsyncGenerator[AsyncIterable[Optional[ReceivedEvent]], None]

distributor

distributor() -> AsyncGenerator[messaging.MessageHandler, None]

start_distributor

start_distributor() -> None
Starts the distributor consumer as a global background task

stop_distributor

stop_distributor() -> None
Stops the distributor consumer global background task

run_distributor

run_distributor(started: asyncio.Event) -> NoReturn
Runs the distributor consumer forever until it is cancelled

Classes

Distributor

Methods:

all_services

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

enabled

enabled(cls) -> bool

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) -> dict[str, str]

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) -> None

start

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

stop

stop(self) -> None

stop

stop(self) -> None
Stop the service