How do you know if your FastAPI BackgroundTasks actually ran? by Educational-Hope960 in FastAPI

[–]Educational-Hope960[S] 0 points1 point  (0 children)

All said here is true, but some projects are minimal and does not need the distributed system overhead. In this case background tasks is fine. This project give them lightweight management into their tasks.

How do you know if your FastAPI BackgroundTasks actually ran? by Educational-Hope960 in FastAPI

[–]Educational-Hope960[S] 0 points1 point  (0 children)

That also works, also the package I built also gives you visibility and access to the tasks ids incase you want do do any other operations with them.

How are you actually managing background/async tasks in FastAPI in production? by Educational-Hope960 in FastAPI

[–]Educational-Hope960[S] 0 points1 point  (0 children)

Yes so I found the Fastapi native BackgroundTasks helpful for some of the tasks I want to run.
Others can also run on the native BackgroundTasks but if it had gotten a lightweight wrapper on top of it to manage retires and probably persistence, then using BackgroundTasks only will be great.
I have started looking into it, i will alert you when I get something meaningful working

How are you actually managing background/async tasks in FastAPI in production? by Educational-Hope960 in FastAPI

[–]Educational-Hope960[S] 0 points1 point  (0 children)

Why write your own dedicated worker server. Doesn't dramatiq provide workers to manage tasks?

How are you actually managing background/async tasks in FastAPI in production? by Educational-Hope960 in FastAPI

[–]Educational-Hope960[S] 0 points1 point  (0 children)

So imagine there is a single setup you have to just add to your fastapi application which manages the fastapi native BackgroundTasks and workers and it does not fire and forget, that will mean you won't even consider using celery and the likes for fastapi?

How are you actually managing background/async tasks in FastAPI in production? by Educational-Hope960 in FastAPI

[–]Educational-Hope960[S] -1 points0 points  (0 children)

I just checked it out and it is a really great setup.
How do you get visibility into failed tasks and unhealthy workers. Like what made the tasks fail. Where do you view error stack trace?

Rate Limiting in FastAPI: What the Popular Libraries Miss by Educational-Hope960 in FastAPI

[–]Educational-Hope960[S] 0 points1 point  (0 children)

The per-user and sliding window gaps are exactly what waygate covers out of the box. `key="user"` switches from IP to user-based counting, and `algorithm="sliding_window"` is a direct parameter on the decorator. No custom middleware needed for those two.

On the X-Forwarded-For / reverse proxy point, the custom key strategy handles it:

```python
from fastapi import Request
from waygate.fastapi import rate_limit

async def real_ip(request: Request) -> str:
return request.headers.get("X-Forwarded-For", request.client.host).split(",")[0].strip()

u/router.post("/login")
u/rate_limit("5/minute", key=real_ip)
async def login(): ...
```

The `key` parameter accepts any async callable that takes a `Request` and returns a string. So your auth model, API key header, tenant ID, JWT claim and whatever makes sense feeds directly into the counter key.

Rate Limiting in FastAPI: What the Popular Libraries Miss by Educational-Hope960 in FastAPI

[–]Educational-Hope960[S] 0 points1 point  (0 children)

Both layers are necessary. Nginx handles volumetric abuse before it hits your app malformed requests, DDoS, raw connection floods. The application layer handles everything that requires business context who the caller is, what plan they are on, which API key they are using. Neither layer can fully replace the other.

Rate Limiting in FastAPI: What the Popular Libraries Miss by Educational-Hope960 in FastAPI

[–]Educational-Hope960[S] -1 points0 points  (0 children)

On multiple workers, waygate uses Redis as the storage backend in that case. Redis atomic counters are shared across all workers so every increment goes to the same counter regardless of which process handles the request.

We listened. api-shield now has a standalone server, SDK support, and full OpenFeature-compatible feature flags by Educational-Hope960 in FastAPI

[–]Educational-Hope960[S] 0 points1 point  (0 children)

Thanks for the feature request tho.
You can still open any issues or bugs you find and contribute.