Skip to content

What is 'ChildTask'? #189

Closed Answered by abelbraaksma
NickDarvey asked this question in Q&A
Discussion options

You must be logged in to vote

@NickDarvey sorry for responding this late, I missed the notification on this thread somehow.

The issue with making IAsyncEnumerable<'T> parallel is non-trivial. The reason is that the interface is deliberately designed in such a way that you must await the MoveNext action (which returns true|false signaling whether there are more elements) before you can get to the Current property.

In other words, calling MoveNext multiple times can lead parallel execution, sure, but it can also lead to reading past the end of the stream and returning items in a random order. What's worse, is that, just like a normal seq, the moments that side effects are executed are very well defined. However, once yo…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@NickDarvey
Comment options

Answer selected by abelbraaksma
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants