broker: List RPC is now server-streaming and supports long-lived watches #389
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The List RPC was originally a unary API, which has two issues:
Often callers want to react to changes in journals, such as reading a
newly created journal or spreading appended messages across the current
set of journals.
client.NewPolledList somewhat enabled this functionality, but is
inefficient and requires selection of a polling interval.
To address both issues, List is updated to become a server-streaming API
while retaining backward comatibility with MOST clients expecting a
unary response, so long as the response size is under one thousand
journals.
The List RPC is also extended with a Watch mode. When enabled, brokers
will continue to stream real-time updates upon every change to the set
of journals which match the selector. This lets clients react instantly
to changes in journal topology.
client.NewPolledList becomes client.NewWatchedList, with a nearly
identical API (the polling interval is removed).
The shard List RPC is not modified by this change, but could follow a
similar path in the future.
This change is