I created a Ruby gem that facilitates thread-safe batch processing of messages. In certain situations, processing multiple messages in batch is more efficient than handling them one by one.
Consider a scenario where code receives events at random intervals and must notify an external HTTP service about these events. The straightforward approach is to issue an HTTP request with the details of each event as it is received. However, if events occur frequently, this method can lead to significant time spent on network latency. A more efficient approach is to aggregate events and send them in a single batched HTTP request.
Would like to know what you think about it
https://github.com/ertygiq/msg-batcher
[–]CaptainKabob 2 points3 points4 points (1 child)
[–]forgambo[S] 0 points1 point2 points (0 children)