Using AsObservable to observe TPL Dataflow blocks without consuming messages

前端 未结 4 1348
星月不相逢
星月不相逢 2021-01-18 06:54

I have a chain of TPL Dataflow blocks and would like to observe progress somewhere inside the system.

I am aware that I could just jam a TransformBlock

4条回答
  •  天命终不由人
    2021-01-18 07:02

    Try replacing:

    obs.ForEachAsync(i => Debug.Print("progressBlock:" + i.ToString()));
    

    with:

    obs.Subscribe(i => Debug.Print("progressBlock:" + i.ToString()));
    

    I'd imagine the ForEachAsync method isn't hooking in properly / it's firing, but something funky is going on with the async portion.

提交回复
热议问题