It is necessary to delete the group of queued dataflow tasks. Simply put, you need to remove some dataflow queue element as needed. Implemented while using the body of the block through the task and cancel it, so to speak, with a local token. Everything seems to work, but there may be a situation when tasks of one group will be randomly scattered around the “queue” and if you cancel them through the task, then the dataflow unit will first need to go through all the necessary blocks so that the cancellation would work. And since there may be other tasks in the queue, it will take a long time.

That is, the question is: are there any native ways to remove elements of the dataflow collection or more correct implementations?

  • Are you using ExecutionDataflowBlockOptions.CancellationToken ? - andreycha
  • @andreycha Yes, but as I understand it it works for the whole block, and not for individual elements. - BwehaaFox
  • There is no direct functionality for removing tasks from the pipeline. And what do they bother you? Let them hang a little, and when the queue reaches them, you check the cancellation token and complete the task. - andreycha

0