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

◆ ConsumeAsyncIfNecessary()

void System.Threading.Tasks.Dataflow.BroadcastBlock< T >.ConsumeAsyncIfNecessary ( bool isReplacementReplica = false)
inlinepackage

Definition at line 757 of file BroadcastBlock.cs.

758 {
759 if (_decliningPermanently || _boundingState.TaskForInputProcessing != null || _boundingState.PostponedMessages.Count <= 0 || !_boundingState.CountIsLessThanBound)
760 {
761 return;
762 }
763 _boundingState.TaskForInputProcessing = new Task(delegate(object state)
764 {
765 ((BroadcastBlock<T>)state).ConsumeMessagesLoopCore();
768 if (log.IsEnabled())
769 {
770 log.TaskLaunchedForMessageHandling(this, _boundingState.TaskForInputProcessing, DataflowEtwProvider.TaskLaunchedReason.ProcessingInputMessages, _boundingState.PostponedMessages.Count);
771 }
773 if (ex != null)
774 {
775 Task.Factory.StartNew(delegate(object exc)
776 {
778 }, ex, CancellationToken.None, Common.GetCreationOptionsForTask(), TaskScheduler.Default);
779 }
780 }
readonly BroadcastingSourceCore< T > _source
void CompleteCore(Exception exception, bool storeExceptionEvenIfAlreadyCompleting, bool revertProcessingState=false)
readonly BoundingStateWithPostponedAndTask< T > _boundingState
static Exception StartTaskSafe(Task task, TaskScheduler scheduler)
Definition Common.cs:277
static TaskCreationOptions GetCreationOptionsForTask(bool isReplacementReplica=false)
Definition Common.cs:267

References System.Threading.Tasks.Dataflow.BroadcastBlock< T >._boundingState, System.Threading.Tasks.Dataflow.BroadcastBlock< T >._decliningPermanently, System.Threading.Tasks.Dataflow.BroadcastBlock< T >._source, System.Threading.Tasks.Dataflow.BroadcastBlock< T >.CompleteCore(), System.Threading.Tasks.Dataflow.BroadcastBlock< T >.BroadcastingSourceCore< TOutput >.DataflowBlockOptions, System.Threading.Tasks.TaskScheduler.Default, System.Threading.Tasks.Task< TResult >.Factory, System.Threading.Tasks.Dataflow.Internal.Common.GetCreationOptionsForTask(), System.Threading.Tasks.Dataflow.Internal.DataflowEtwProvider.Log, System.Threading.CancellationToken.None, System.Threading.Tasks.Dataflow.Internal.Common.StartTaskSafe(), System.state, System.Threading.Tasks.Dataflow.Internal.BoundingStateWithPostponedAndTask< TInput >.TaskForInputProcessing, and System.Threading.Tasks.Dataflow.DataflowBlockOptions.TaskScheduler.

Referenced by System.Threading.Tasks.Dataflow.BroadcastBlock< T >.ConsumeMessagesLoopCore(), and System.Threading.Tasks.Dataflow.BroadcastBlock< T >.OnItemsRemoved().