run_in_background¶
- YouTubeNotifier.run_in_background(*, host: str = '0.0.0.0', port: int = 8000, app: FastAPI | None = None, log_level: int = 30, **configs: object) Iterator[Thread]¶
- Start the FastAPI server to receive push notifications in the separate
thread and return immediately.
- Parameters:
host – The host to run the FastAPI server on.
port – The port to run the FastAPI server on.
log_level – The log level to use for the uvicorn server.
app – The FastAPI app instance to use. If not provided, a new instance will be created.
configs – Additional arguments to pass to the Config class of uvicorn.
- Returns:
A thread that runs the FastAPI server in the background.
- Raises:
ValueError – If the given app instance has a route that conflicts with the notifier’s routes.