feat: streaming ListTags rpc call #131
Draft
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.
Description
This makes the ListTags rpc call streaming instead of returning a single
Vec<TagInfo>
. Returning a Vec was the quickest to implement, but would be an issue if somebody had a giant number of tags, which we all know people will do eventually...It also adds quite a bit of plumbing to deal with the very common case where you have an irpc stream item enum with 3 cases, item/error/done to provide an explicit marker for successful termination.
It also moves the handling of the only metadata call that requires a task - listblobs, into the metadata actor itself so the metadata actor is more self-contained. Unfortunately this means that the metadata actor also needs a JoinSet of tasks, but this will make it easier later to have the metadata db as a separate component for things like #84
Breaking Changes
Changes the ListTags rpc return type.
Not sure what is wrong with the semver check, but there are breaking changes!
Notes & open questions
Note: if the IrpcStreamItem stuff turns out useful enough I might move it into irpc and add some macros to make declaring these easier. But for now I don't want to do this since I don't want a genawaiter dependency in irpc, and I can't be bothered to manually write the into_stream state machine.
Change checklist