Comments (3)
Ah this is probably a shortcoming on my side when I implemented this. The fact that it's a finally means it always runs the drain async.
We probably have avenues opportunities here:
- Clone the stream into a memory stream, and return that memory stream instead. This might lead to higher memory usage.
- Add a condition in the finally. Consumers might lock the connections if they don't dispose the stream in that case.
Thoughts?
from kiota-http-dotnet.
I believe there are scenarios where the response content may be large and consumers would not want/accept to load the entire stream into memory in some scenarios. On a side note, we should also probably add support for passing the HttpCompletionOption to the httpClient as well.
I think adding a condition for streams should be okay as we already call ReadAsStreamAsync()
here for streams so the connection should be released as we have read the response body.
from kiota-http-dotnet.
Makes sense, thanks for the input. I'm not sure what would be the impact for the completion options (worried about side effects on the service side). Would one of you be so kind to submit a PR to add the condition to the finally please?
from kiota-http-dotnet.
Related Issues (18)
- Blazor WASM client unable to send web requests through HttpClient BaseAddress HOT 4
- Pass HttpCompletionOption.ResponseHeadersRead to HttpClient for Stream responses
- Null reference exception when template is null
- parameters names decoding handler also decodes values
- KiotaClientFactory is missing key helper methods in C# HOT 2
- Configurable defaults for `ObservabilityOptions` in http middleware HOT 4
- System.Text.Json dependency constraint for .NET 8 scenarios HOT 2
- How do I react to unexpected status codes? HOT 1
- KiotaClientFactory doesn't build a httpclient that will work because it is missing auth middleware HOT 2
- Activity source memory leak HOT 1
- ApiException should return mapped error response if it parses successfully HOT 2
- map XXX error status code
- Is there any way to get response body when status code is unsuccessful? HOT 5
- ensure 3XX responses without location header do not throw
- RetryHandler should add more information on failures HOT 1
- Rename ThrowFailedResponse to ThrowIfFailedResponse HOT 1
- Add static analyzers dotnet Abstraction libraries HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kiota-http-dotnet.