https://github.com/asynq-io/eventiq-fastapi
FastAPI integration for eventiq
https://github.com/asynq-io/eventiq-fastapi
asyncio eventiq fastapi
Last synced: 3 months ago
JSON representation
FastAPI integration for eventiq
- Host: GitHub
- URL: https://github.com/asynq-io/eventiq-fastapi
- Owner: asynq-io
- License: apache-2.0
- Created: 2024-08-05T12:03:37.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-12-16T03:02:45.000Z (7 months ago)
- Last Synced: 2025-04-02T04:35:01.347Z (3 months ago)
- Topics: asyncio, eventiq, fastapi
- Language: Python
- Homepage:
- Size: 17.6 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README




[](https://github.com/charliermarsh/ruff)
[](https://github.com/PyCQA/bandit)


# eventiq-fastapi
FastAPI integration for eventiq
## Installation
```shell
pip install eventiq-fastapi
```## Usage
```python
from fastapi import FastAPI
from eventiq import Service, CloudEvent
from eventiq_fastapi import ServiceDependency, get_service_lifespanservice = 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")
```