Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Enable EventHubs WebJobs extension live tests #17029
Enable EventHubs WebJobs extension live tests #17029
Changes from all commits
4394fc9
c083087
2fb9da9
8641af3
a83e8ae
eb03e70
553e62b
a811707
2e0ce90
ef3c8bc
c74f95f
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Some tests rely on this message.
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.
Can this be
ThreadSafetyMode.PublicationOnly
or is it expensive to potentially throw one out in a race?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.
is there a benefit to it?
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.
As I understand it, a minor one. Instead of grabbing a primitive to ensure that only one thread can create the value, it will allow multiple threads to race for it and keep just the first via atomic swap.
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'm not extremely happy with the data flow here but I started with removing the duplication first.
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.
You may want to consider capturing the
messages.ToArray()
return from line 153 and using that here; you're enumerating anIEnumerable<T>
multiple times. Pragmatically, we returnIReadOnlyList<EventData>
from theEventProcessor<T>
. Since you're already paying the array transform cost, may as well use it. I wonder if, long term, it would make sense to useIReadOnlyList
instead of an array and avoid the transforms altogether.