Repository navigation
Give the ureq host clients that keep templates, a buffer and a key - #53
Open
tiptenbrink wants to merge 1 commit into
Open
tiptenbrink wants to merge 1 commit into
tiptenbrink wants to merge 1 commit into
Conversation
azure::Blobs and s3::Objects write each template once, write every request into one buffer they grow only when a request does not fit, and send with one agent. Requests are kept as a Placement, so the buffer can grow and be written again; puts now send their content themselves. s3::Objects derives the SigV4 signing key once per UTC day. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 ureq host wrote a fresh template and a fresh buffer for every request, and built a new
ureqagent each time. It encoded each request twice: once into an empty buffer to learn its size, and once for real. It now has a client per provider that keeps what a request can reuse.azure::Blobsands3::Objectswrite the template of each kind of request (get, put, delete, list) once, innew. The list options are given there, since the list template depends on them.grown_to_fitwrites into it as it is, and grows it and writes again only onError::Capacity. Once the buffer fits the longest request, each request is encoded once.Placementwhile the buffer may grow, and read back withplacement.request(&buf). That drops the borrow of the caller's content, so the puts now pass their content tosendthemselves.s3::Objectsderives the SigV4 signing key on the first request of each UTC day and keeps it. A unit test checks that a kept key signs for the rest of its day and that the next day's key is derived again.The examples and the loopback tests make a client once and call its methods.
azure_put, which calls the proto directly, is unchanged.Not in this PR: encoders that return a
Placementthemselves, which would remove the.map(|request| request.placement())at each call.