Combining parallel and async doesn't make much sense. The purpose of parallelism is about using more than one processors/cores simultaneously, while the purpose of asynchrony is about not using any CPU resources at all.
The AsParallel
(PLINQ) is used with IEnumerable
s in cases when enumerating the IEnumerable
is CPU-intensive. In other words when many-many CPU instructions have to be executed between the one MoveNext
invocation and the next. With IAsyncEnumerable
s the delay is (normally) not caused by the invocation of the MoveNextAsync
method itself, but by the awaiting of the returned ValueTask
. Waiting an awaitable object consumes zero CPU resources. And you have no control about when it's going to complete. Take for example a Task.Delay(1000)
. It will complete not sooner than a second later, and you couldn't force it to complete in half a second unless you find a way to bend the spacetime somehow.