The type signature for the LinkTo
extension method should shed some light on what's wrong:
LinkTo<TOutput>(ISourceBlock<TOutput>, ITargetBlock<TOutput>)
You're specifying a BatchBlock<T>
as the source, and an ActionBlock<T>
as the target, with the generic type T
being IEnumerable<string>
. However, the former implements ISourceBlock<T[]>
, whilst the latter implements ITargetBlock<T>
; thus, they are incompatible for being specified as arguments to the LinkTo
method, which expects them to have the same type.
To fix this, you need to change your signature (and implementation) of actionBlock
to:
var actionBlock = new ActionBlock<IEnumerable<string>[]>(enumerables => ...
// ^ accept an array of enumerables