Block suspension
-
2011년 8월 15일 월요일 오전 3:09
What do you think about offering the option to temporarily suspend blocks - maybe by passing something like a SuspensionToken into ExecutionDataflowBlockOptions. This is to allow Dataflow networks to work in the background - so you pause them when the UI is busy or you've got a foreground task running.
Because Dataflow is so good at getting the CPU hot, the ability to pause the network is perhaps more important than a background process that uses only one core.
A workaround would be to have code within the processing delegate await a custom suspension token and return a Task to the block. But then Dataflow would assume those blocks aren't making progress and may take action such as increasing concurrency, right?
A SuspensionToken may also open up unit testing possibilities, although this would require a more elaborate interface (e.g., the ability to let the block process a single message and continue).
Write LINQ queries interactively - www.linqpad.net
모든 응답
-
2011년 8월 22일 월요일 오후 3:02소유자
Hi Joe-
Thanks for the suggestion. It's something we've considered in the past and may revisit. In the meantime, you could approximate this by setting the BoundedCapacity for the target block to 1, and the unlinking / relinking it from its source in order to suspend / resume.
- 답변으로 제안됨 Stephen Toub - MSFTMicrosoft Employee, Owner 2011년 8월 22일 월요일 오후 3:02
- 답변으로 표시됨 Joe AlbahariMVP 2011년 8월 23일 화요일 오전 11:46

