stream results from searcher
Created by: camdencheek
This commit adds result streaming support to searcher. The functionality is currently behind a feature flag, but the intent is to turn it on by default and remove the batch API once we've seen it working stably on sourcegraph.com.
Each commit is self-contained, so it may make sense to review commit-by-commit.
Closes #22518 (closed)
Overview:
- We use server-sent events (SSE) for the wire format.
- It's a little unusal to use it for backend-to-backend communication (with no browser involved), but we've already been successful with this format when streaming to the UI, so I felt introducing a new wire encoding was unwarranted.
- Swapping out is easy if we decide to change this
- The SSE decoder is split out of the existing client and re-used between the searcher and the frontend clients.
- The functionality is currently behind the feature flag
cc_streaming_searcher
Plan:
- Merge this PR (pending feedback)
- Enable feature flag for my user on sourcegraph.com
- Test performance on the scale of sourcegraph.com, watch for instability
- Enable feature flag for all users on sourcegraph.com
- Monitor for searcher instability for ~1w
- Remove the batch API code