Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ BroadcastBlock() [2/2]

System.Threading.Tasks.Dataflow.BroadcastBlock< T >.BroadcastBlock ( Func< T, T >? cloningFunction,
DataflowBlockOptions dataflowBlockOptions )
inline

Definition at line 625 of file BroadcastBlock.cs.

626 {
627 if (dataflowBlockOptions == null)
628 {
629 throw new ArgumentNullException("dataflowBlockOptions");
630 }
633 if (dataflowBlockOptions.BoundedCapacity > 0)
634 {
637 }
640 {
641 IDataflowBlock dataflowBlock = (BroadcastBlock<T>)state;
642 dataflowBlock.Fault(completed.Exception);
643 }, this, CancellationToken.None, Common.GetContinuationOptions() | TaskContinuationOptions.OnlyOnFaulted, TaskScheduler.Default);
645 {
646 ((BroadcastBlock<T>)state).Complete();
647 }, this);
649 if (log.IsEnabled())
650 {
651 log.DataflowBlockCreated(this, dataflowBlockOptions);
652 }
653 }
readonly BroadcastingSourceCore< T > _source
readonly BoundingStateWithPostponedAndTask< T > _boundingState
static TaskContinuationOptions GetContinuationOptions(TaskContinuationOptions toInclude=TaskContinuationOptions.None)
Definition Common.cs:262
static void WireCancellationToComplete(CancellationToken cancellationToken, Task completionTask, Action< object > completeAction, object completeState)
Definition Common.cs:93
Task ContinueWith(Action< Task< TResult > > continuationAction)
Definition Task.cs:263

References System.Threading.Tasks.Dataflow.BroadcastBlock< T >._boundingState, System.Threading.Tasks.Dataflow.BroadcastBlock< T >._source, System.Threading.Tasks.Dataflow.BroadcastBlock< T >.BroadcastingSourceCore< TOutput >.Completion, System.Threading.Tasks.Task< TResult >.ContinueWith(), System.Threading.Tasks.TaskScheduler.Default, System.Threading.Tasks.Dataflow.Internal.Common.GetContinuationOptions(), System.Threading.Tasks.Dataflow.Internal.DataflowEtwProvider.Log, System.Threading.CancellationToken.None, System.Threading.Tasks.Dataflow.BroadcastBlock< T >.OnItemsRemoved(), System.state, and System.Threading.Tasks.Dataflow.Internal.Common.WireCancellationToComplete().