deepkit / deepkit-framework

A new full-featured and high-performance TypeScript framework
https://deepkit.io/
MIT License
3.24k stars 123 forks source link

Provide batch mechanism in Message Queue #575

Open colorcube opened 5 months ago

colorcube commented 5 months ago

It would be nice to have some batch mechanism in Message Queue.

Like: give me a batch of 10 messages but don't wait longer than 30 s. Using such a buffer means the worker has to process array of something.

I used rxjs for such a thing: bufferTime(bufferTimeSpan, undefined, maxBufferSize)

marcj commented 5 months ago

Note: we should add the same mechanism to message bus. maybe worth trying to see if rxjs can be used for that