-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes #139 There are other potential long term solutions listed [here](#139 (comment)) > I didn't put much thought into it. Internally there used to be a `Box<[Arc<dyn Middleware>]>` which is cloned about quite often. > > * https://docs.rs/reqwest-middleware/0.2.5/src/reqwest_middleware/client.rs.html#87 > * https://docs.rs/reqwest-middleware/0.2.5/src/reqwest_middleware/client.rs.html#139 > > Because of all the cloning, I decided to flip it to be `Arc<Box>` instead of `Box<Arc>`. > > I see three solutions here. > > 1. The one I'd lean towards is `Arc<Arc>` even if it's a bit silly, but prevents extra unnecessary allocations on each request. > 2. An alternative is to implement Middleware for Arc and then you can use the regular with(...) api. This would mean there's an extra box around your middleware > 3. Revert this particular change In the short term, I think it's best to go with option 3. This will unblock the next release. We can consider the other options for future releasees
- Loading branch information
Showing
3 changed files
with
26 additions
and
25 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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