Skip to main content

FastAPI integration for eventiq

Project description

Tests Build License Mypy Ruff security: bandit Python Format PyPi

eventiq-fastapi

FastAPI integration for eventiq

Installation

pip install eventiq-fastapi

Usage

from fastapi import FastAPI
from eventiq import Service, CloudEvent
from eventiq_fastapi import ServiceDependency, get_service_lifespan


service = Service(...)
app = FastAPI(lifespan=get_service_lifespan(service))

# possibly in dirrerent file/router, service will be injected
@app.post("/send-email")
async def send_mail(service: ServiceDependency):
    await service.send({"some": "data"}, topic="commands.send-email")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

eventiq_fastapi-0.1.0.tar.gz (9.9 kB view hashes)

Uploaded Source

Built Distribution

eventiq_fastapi-0.1.0-py3-none-any.whl (8.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page