Closed Uzlopak closed 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
@mcollina
Do you think it makes sense to create a new package called @fastify/throttle?
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)
Created a new repo fastify/throttle and will do the changes there.
Checklist
npm run test
andnpm run benchmark