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

Added FlushAsync function which is called from CommitAsync with await keyword #1629

Merged
merged 4 commits into from
Jan 2, 2025

Conversation

PoteRii
Copy link
Contributor

@PoteRii PoteRii commented Dec 26, 2024

Description:

Added FlushAsync function which is called from CommitAsync with await keyword to ensure that multiple messages are produced in correct order from a single transaction

Issue(s) addressed:

How to test:

Produce multiple messages inside a single transaction and check the order

Checklist:

  • [ ✓] I have tested my changes locally
  • I have added necessary documentation (if applicable)
  • I have updated the relevant tests (if applicable)
  • [ ✓] My changes follow the project's code style guidelines

@@ -68,6 +68,29 @@ protected virtual void Flush()
}
}

protected virtual async Task FlushAsync()
Copy link
Member

Choose a reason for hiding this comment

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

Why not have Flush() call FlushAsync()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed

{
while (!_bufferList.IsEmpty)
{
#pragma warning disable CA2012 // Use ValueTasks correctly
Copy link
Member

Choose a reason for hiding this comment

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

Remove the #pragma warning

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed

Copy link
Member

@yang-xiaodong yang-xiaodong left a comment

Choose a reason for hiding this comment

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

LGTM, Thanks

@yang-xiaodong yang-xiaodong merged commit 8575109 into dotnetcore:master Jan 2, 2025
2 checks passed
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