deepkit / deepkit-framework

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

Provide batch mechanism in Message Queue #575

Open colorcube opened 2 weeks ago

colorcube commented 2 weeks 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 1 week ago

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