What is 'ChildTask'? #189
-
The README mentions parallelism is possible with FSharp.Control.TaskSeq/README.md Line 199 in 32c7a47 Is the planned support (also mentioned) something like operators that let you specify the degree of paralellism? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@NickDarvey sorry for responding this late, I missed the notification on this thread somehow. The issue with making In other words, calling
This term comes from In general, I have been wanting to add (easy) parallelism to the library, but as you may have guessed, parallelism is never easy. My current idea is to either take On the latter, the only way I see this working is if there's a worker that tells us that we can It is easy to confuse an async sequence with a sequence of asyncs. The first is supposed to be executed in order, while the other can be executed in parallel, or at will, in any order. PS: is there a specific use case you had in mind? It may help prioritize this. |
Beta Was this translation helpful? Give feedback.
@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 mustawait
theMoveNext
action (which returnstrue|false
signaling whether there are more elements) before you can get to theCurrent
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 normalseq
, the moments that side effects are executed are very well defined. However, once yo…