-
Notifications
You must be signed in to change notification settings - Fork 419
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
Fix AwaitCompletion to yield results during source iteration #505
Merged
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
1ba1162
Use continuations to report tasks to support slow sources
atifaziz a30df54
End notice unnecessary
atifaziz d973670
Refactor to observable
atifaziz 86c94f9
Move general helpers down
atifaziz 4a4e08d
To-do notes about exceptional cases
atifaziz 3111a90
Add arg validation to StartAsync
atifaziz 688c2ee
Don't allocate semaphore if unbounded concurrency
atifaziz 616241b
Fold lazy start semantics into StartAsync
atifaziz 4514060
Consolidate pending completion actions
atifaziz da262bc
Revert "Refactor to observable"
atifaziz 03419d3
Don't treat cancellation as completion; return early
atifaziz 91f4896
Filter token when catching OperationCanceledException
atifaziz 98ddd41
Add back (missing) end notice break
atifaziz cf71a25
Crititcal error handling
atifaziz af05bd6
Minor reivew/clean-up of formatting and names
atifaziz 5f6a23b
Move notification & error handling in main iterator
atifaziz 5c759e6
Remove reundant cancellation for simplicity
atifaziz 69d5341
Move EDI capture into critical section
atifaziz 8dbdcbe
Capture original error with error notification failure
atifaziz 57212f2
Lots of comments
atifaziz bda7187
Fix typo (s/Remainde/Remainder/)
atifaziz e956b46
Model a concurrency gate around the semaphore
atifaziz ec6e365
Re-format conditional expression
atifaziz 467ba7c
Move CompletedTask singleton into own class
atifaziz 4a5cfd3
Fix ConcurrencyGate.EnterAsync to handle cancellation
atifaziz 30478c0
Rename task completion parameter for clarity
atifaziz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
What is the purpose of wrapping the
AggregateException
with anException
?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.
The rationale behind this is that the
AggregateException
is an informational detail of the critical exception that's actually being raised. The exception raised here is due to a critical condition that made it impossible for the method to guarantee correct operation and report the original exception(s) (in the detail, as an aggregate).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 following. This exception is telling me one or more errors occured. And this is precisely what
AggregateException
is for.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.
AggregateException
is common with tasks and could confuse someone ifAwaitCompletion
throws it too, and if they have a catch forAggregateException
. My intention was to make a clear distinction here. This is a single exception due to critical conditions, period. The aggregate within is for informational and diagnostic purposes only. Perhaps this is a futile attempt at semantics that exist just in my head?