public BlockContainerMerger(BlockContainer <T1, T2> b1, BlockContainer <T2, T3> b2) : base(BlockContainerOptions.Default) { m_b1 = b1; m_b2 = b2; m_b1.LinkTo(m_b2); RegisterChild(m_b1); RegisterChild(m_b2); }
public static BlockContainer <TIn, TOut> AutoComplete <TIn, TOut>(this BlockContainer <TIn, TOut> blockContainer, TimeSpan timeout) where TIn : ITracableItem where TOut : ITracableItem { var autoCompletePair = new AutoCompleteContainerPair <TIn, TOut>(timeout); var merged = new BlockContainerMerger <TIn, TIn, TOut, TOut>( autoCompletePair.Before, blockContainer, autoCompletePair.After); return(merged); }
protected void RegisterChild(BlockContainer childContainer, Action <Task> containerCompletionCallback = null) { if (childContainer == null) { throw new ArgumentNullException("childContainer"); } if (m_children.OfType <BlockContainerMeta>().Any(cm => cm.Container.Equals(childContainer))) { throw new ArgumentException("Duplicate block container registered in " + this.Name); } m_children = m_children.Add(new BlockContainerMeta(childContainer, this, containerCompletionCallback)); }
protected ChildMetaBase(BlockContainer host, Action <Task> completionCallback) { m_host = host; m_completionCallback = completionCallback; }
public BlockContainerMeta(BlockContainer childContainer, BlockContainer host, Action <Task> completionCallback = null) : base(host, completionCallback) { m_childContainer = childContainer; m_completion = GetWrappedCompletion(m_childContainer.CompletionTask); }
public BlockMeta(IDataflowBlock block, BlockContainer host, Action <Task> completionCallback = null) : base(host, completionCallback) { m_block = block; m_completion = GetWrappedCompletion(m_block.Completion); }