📜  batchblock 超时 - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:07.506000             🧑  作者: Mango

代码示例1
Timer triggerBatchTimer = new Timer(() => yourBatchBlock.TriggerBatch());

TransformBlock timeoutTransformBlock = new TransformBlock((value) =>
{
    triggerBatchTimer.Change(5000, Timeout.Infinite);

    return value; 
});

timeoutTransformBlock.LinkTo(yourBatchBlock);

yourBufferBlock.LinkTo(timeoutTransformBlock);