When using System.Threading.Tasks.Dataflow
, if I link block a
to block b
, will the link keep b
alive? Or do I need to keep a reference to b
around to prevent it from being collected?
internal class SomeDataflowUser
{
public SomeDataflowUser()
{
_a = new SomeBlock();
var b = new SomeOtherBlock();
_a.LinkTo(b);
}
public void ReactToIncomingMessage( Something data )
{
// might b be collected here?
_a.Post( data );
}
private ISourceBlock<Something> _a;
}
See Question&Answers more detail:os