fastify / fastify-rate-limit

A low overhead rate limiter for your routes
MIT License
480 stars 67 forks source link

throttle #308

Closed Uzlopak closed 1 year ago

Uzlopak commented 1 year ago

Checklist

Uzlopak commented 1 year ago

You should use pipeline instead, .pipe does not add error handling.

Ok, I will use pipeline

Note that using an intermediate stream adds significant overhead.

Should I put that into the readme? Or is there a different approach, that I am not aware of?

I actually wanted to write about the feature for the blog of @Eomm

https://github.com/Uzlopak/blog/blob/main/case.md

Uzlopak commented 1 year ago

@mcollina

Do you think it makes sense to create a new package called @fastify/throttle?

Uzlopak commented 1 year ago

I am actually working on the distributed part.

see https://github.com/Uzlopak/blog/blob/main/case.md#throttlegroups

also yes, i initially wanted to just handle streams. Maybe make it optional to handle also buffer and strings if an option is set (opt-in)

Uzlopak commented 1 year ago

Created a new repo fastify/throttle and will do the changes there.