-
Notifications
You must be signed in to change notification settings - Fork 372
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create multiple Client implementations to solve different use cases #764
Comments
Can we have some benchmarks showing the performance difference between the native http libraries and dart's current stable and universal solution? |
Hey @feinstein , I made an attempt to generate benchmarks but they were unconvincing. I would say that the native libraries have no clear advantages for sequential requests over reliable connections. |
Interesting... Thanks! |
Hi! Unfortunately, we are facing crash using final _client = SentryHttpClient(
client: Platform.isIOS
? CupertinoClient.defaultSessionConfiguration()
: http.Client(),
); In both cases after some time playing around, i could face the following crash:
|
Hey @lavinov-mercury , thanks for the bug report. I refiled it as #785. Would it be possible for you to add a snippet where you are actually making a call using the client? |
@lavinov-mercury This should be fixed in 0.0.6 - could you give it a try?
|
Hi! Thanks for making this. I've been browsing the code and it looks like you don't support data uploads in the background. Is this something you intend to add in the near term? Thank you! |
@duncaninsiris On what platform are you thinking? It might be possible to do this using the |
This issue tracks the implementation of different
package:http Client
implementations.Status
package:http_client_conformance_tests
has been implemented but not released.package:cupertino_http
has been released as part oflabs.dart.dev
.package:cronet_http
is under development but has not been publishedBackground
The Dart ecosystem makes it difficult or impossible for users to access certain features desirable in an HTTP client e.g. HTTP 3 support, platform constructs (e.g. VPN, proxy and shared cookie support on iOS)
Where features are present in non-core packages, they present a novel interface that would require significant effort to adopt. For example, users wanting to use package:http2 would have to change their HTTP code completely when moving from the dart:io HttpClient.
Finally, it is difficult to contribute to dart:io HttpClient since modifying it requires understanding the Dart build process, navigating a Googler-only CI system, etc.
Solution
Allow developers to choose their own HTTP client implementation at runtime based on the platform, desired capabilities, etc.
The Dart team should develop HTTP implementations based on:
These implementations should support the
package:http Client
interface so that they can be used interchangeably.There should be a conformance test that verifies that these implementations correctly implement the
package:http Client
interface.The text was updated successfully, but these errors were encountered: