Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Elegant Way to Stop Processing a Dataflow #5

Closed
dbman86 opened this issue Jan 26, 2016 · 3 comments
Closed

Elegant Way to Stop Processing a Dataflow #5

dbman86 opened this issue Jan 26, 2016 · 3 comments

Comments

@dbman86
Copy link

dbman86 commented Jan 26, 2016

hello, based on a condition in one of our subflows or "blocks", we would like to stop processing the current dataflow. however, we do want to re-use the dataflow for many posts so I don't think want to propogate completion for all children after. Can you think of an elegant way to do this?

thanks

@dbman86
Copy link
Author

dbman86 commented Jan 26, 2016

from what i found, way to do this would be to use a buffer block, something like this. Do you agree or have an easier way?

var forwarder = new BufferBlock<SomeType>();
forwarder.LinkTo(target1, item => matchesTarget1(item));
forwarder.LinkTo(DataflowBlock.NullTarget<SomeType>(), item => !matchesTarget1(item));

@karldodd
Copy link
Contributor

karldodd commented Feb 1, 2016

Hi @santoorman, though this is not a DataflowEx question (but a Dataflow one), my two cents here:

Suppose you have A -> B and want to reuse B. You can basically unlink A->B and then link C->B. Unlink is supported by calling Dispose() on the return value of LinkTo() method:

https://msdn.microsoft.com/en-us/library/hh194692(v=vs.110).aspx

Not sure whether this is what you want.

@karldodd
Copy link
Contributor

karldodd commented Mar 8, 2016

Close as there is no response. Please reopen if the problem still exists.

@karldodd karldodd closed this as completed Mar 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants