FastPubSub class¶
fastpubsub.FastPubSub
¶
FastPubSub(
broker,
*,
on_startup=None,
on_shutdown=None,
after_startup=None,
after_shutdown=None,
liveness_url="/consumers/alive",
readiness_url="/consumers/ready",
**extras,
)
Bases: FastAPI, Application
A FastAPI integration application for managing Pub/Sub consumers.
Initializes the FastPubSub application.
| PARAMETER | DESCRIPTION |
|---|---|
broker
|
The PubSubBroker instance.
TYPE:
|
on_startup
|
A sequence of callables to run on startup.
TYPE:
|
on_shutdown
|
A sequence of callables to run on shutdown.
TYPE:
|
after_startup
|
A sequence of callables to run after startup.
TYPE:
|
after_shutdown
|
A sequence of callables to run after shutdown.
TYPE:
|
liveness_url
|
A url path for the readiness endpoint.
TYPE:
|
readiness_url
|
A url path for the readiness endpoint.
TYPE:
|
**extras
|
Extra arguments to pass to the FastAPI constructor.
TYPE:
|
Source code in fastpubsub/applications.py
on_startup
¶
Decorator to register a function to run on startup.
| PARAMETER | DESCRIPTION |
|---|---|
func
|
The function to run on startup.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
NoArgAsyncCallable
|
The decorated function. |
Source code in fastpubsub/applications.py
on_shutdown
¶
Decorator to register a function to run on shutdown.
| PARAMETER | DESCRIPTION |
|---|---|
func
|
The function to run on shutdown.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
NoArgAsyncCallable
|
The decorated function. |
Source code in fastpubsub/applications.py
after_startup
¶
Decorator to register a function to run after startup.
| PARAMETER | DESCRIPTION |
|---|---|
func
|
The function to run after startup.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
NoArgAsyncCallable
|
The decorated function. |
Source code in fastpubsub/applications.py
after_shutdown
¶
Decorator to register a function to run after shutdown.
| PARAMETER | DESCRIPTION |
|---|---|
func
|
The function to run after shutdown.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
NoArgAsyncCallable
|
The decorated function. |