-
Notifications
You must be signed in to change notification settings - Fork 370
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
Migrate from Newtonsoft.Json to System.Text.Json #672
base: master
Are you sure you want to change the base?
Conversation
Also, in commit 6a87013 I improved all the HTTP requests to deserialize the JSON payload directly from the HTTP response stream instead of reading the response as string then deserializing to model objects. This is an improvement in both speed and memory allocations. |
using (var stream = await streamTask) | ||
using (var reader = new StreamReader(stream, new UTF8Encoding(false))) | ||
using (var jsonReader = new JsonTextReader(reader) { SupportMultipleContent = true }) | ||
using (cancellationToken.Register(() => tcs.TrySetCanceled(cancellationToken))) | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verify this task can be cancelled by running the test CreateContainerAsync_TimeoutExpires_Fails
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the Skip
reason and I can confirm that the tests with the 3 different timeouts are passing. ✅
Everything is now truly async, no more fake
Task.Factory.StartNew
async.