Skip to main content
FastAPI logo

FastAPI

z4j-fastapi · Upstream project

Lifespan-hook integration for async stacks.

FastAPI lifespan-aware. Most commonly paired with arq or taskiq (both async-native) but works with Celery or RQ when your sync stack calls for them. Dependency-injection friendly.

Install

bash
pip install z4j-fastapi[arq]

Wire it in

python
from fastapi import FastAPI
from z4j_fastapi import install

app = FastAPI(lifespan=install)
What you get

FastAPI-specific features

FastAPI lifespan integration
Async-native (arq / taskiq best fit)
Dependency-injection helpers
Works alongside Celery / RQ too
WebSocket-aware health checks
Engine pairings

FastAPI works with every z4j engine

The framework adapter handles lifecycle and config. Any engine adapter slots in alongside.

Other platforms

See also

Get started with z4j + FastAPI