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

Exposing DataDispatcher child dataflows and their dispatch function? #16

Open
BillHertzing opened this issue Nov 28, 2017 · 1 comment
Labels

Comments

@BillHertzing
Copy link

I would like to use the DataDispatcher to create child TransientBuffers, which, when created, would accept messages having a specific signature, and buffer these messages. Buffering to occur because when created, they would not be linked to a downstream flow. Later, when an async httpclient fetch completes, messages having these specific signatures can be processed, so at that time, I'd like to link the child TransientBuffers to a _terminator flow. Is it possible (and what syntax would I use) to get an IEnumerable of all child dataflows whose ISourceBlock is NOT linked at all ( or not linked to a specific dataflow)? and having produced that list of child dataflows, determine what the dispatch function is for each?

@karldodd
Copy link
Contributor

karldodd commented Jan 5, 2018

@BillHertzing I guess what you need is the m_destinations variable in DataDispatcher class:

protected ConcurrentDictionary<TKey, Lazy<Dataflow<TIn>>> m_destinations;

Since this class member is protected, you can easily expose it in your own subclass as a property and enumerable through the values of m_destinations to get an IEnumerable of all child dataflows.

and having produced that list of child dataflows, determine what the dispatch function is for each?

DataDispatcher uses only one dispatch function( Func<TIn, TKey> dispatchFunc ), so all the children have the same dispatch function. I guess what you mean is the return value of the dispatch function for every child? That could also be retrieved by the keys of m_destinations dictionary, as mentioned above.

Hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants