Skip to content
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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

0xced
Copy link
Contributor

@0xced 0xced commented Mar 7, 2024

Everything is now truly async, no more fake Task.Factory.StartNew async.

@0xced
Copy link
Contributor Author

0xced commented Mar 7, 2024

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)))
{
Copy link
Contributor

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.

Copy link
Contributor Author

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. ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants