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

Support events. #94

Merged
merged 2 commits into from
Jul 4, 2024
Merged

Support events. #94

merged 2 commits into from
Jul 4, 2024

Conversation

ejball
Copy link
Contributor

@ejball ejball commented Jul 4, 2024

No description provided.

@ejball ejball merged commit b066e5f into FacilityApi:master Jul 4, 2024
3 checks passed
@ejball ejball deleted the events branch July 4, 2024 13:55
Comment on lines +251 to +255
#if NET6_0_OR_GREATER
stream = await httpResponse.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false);
#else
stream = await httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false);
#endif
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you do await using var vs using var here (and drop the code in the finally block)?

Comment on lines +324 to +328
#if NETSTANDARD2_1_OR_GREATER || NET6_0_OR_GREATER
await stream.WriteAsync(s_errorEventLine, cancellationToken).ConfigureAwait(false);
#else
await stream.WriteAsync(s_errorEventLine.ToArray(), 0, s_errorEventLine.Length, cancellationToken).ConfigureAwait(false);
#endif
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Defining an extension method (for WriteAsync on old frameworks) that takes Memory<T> and uses MemoryMarshal.TryGetArray (or ToArray, but I assume the former should work) can avoid needing to sprinkle all these #if through the rest of the code.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

2 participants