c# - How do I detect all TransformManyBlocks have completed -


i have transformmanyblock creates many "actors". flow through several transformblocks of processing. once of actors have completed of steps need process whole again.

the final

var copyfiles = new transformblock<actor, actor>(async actor => {     //copy fo files , wait until done     await actor.copyfiles();     //pass me along next process     return actor; }, new executiondataflowblockoptions() { maxdegreeofparallelism = -1 }); 

how detect when of actors have been processed? completions seems propagated , tell there no more items process. doesn't tell me when last actor finished processing.

completion in tpl dataflow done calling complete returns , signals completion. makes block refuse further messages continues processing items contain.

when block completes processing items completes completion task. can await task notified when block's work has been done.

when link blocks (with propogatecompletion turned on) need call complete on first , await last one's completion property:

var copyfilesblock = new transformblock<actor, actor>(async actor => {     await actor.copyfilesasync();     return actor; }, new executiondataflowblockoptions { maxdegreeofparallelism = -1 });  // fill copyfilesblock  copyfilesblock.complete(); await copyfilesblock.completion; 

Comments

Popular posts from this blog

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -

YouTubePlayerFragment cannot be cast to android.support.v4.app.Fragment -