Skip to content

Search backend: create batchingStream

Warren Gifford requested to merge backend-integration/cc/batched-stream into main

Created by: camdencheek

This creates a new stream type: batchingStream. This is a stream type that batches events up to a maximum delay, then sends them to its parent stream. What's the point? Well, right now, we have a "batchEvents" function that batches events sent down a channel, but it doesn't conform to our standard streaming.Sender interface, so it can only be used at the streaming search API layer. As a bonus, this is faster than using goroutines and channels. Approximately 3-5x faster based on my benchmarks. And that's not taking into account that for streaming, we're sending events down an unbuffered channel, which will slow that down even more.

Merge request reports

Loading