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

◆ ProcessMessageWithTask()

void System.Threading.Tasks.Dataflow.TransformManyBlock< TInput, TOutput >.ProcessMessageWithTask ( Func< TInput, Task< IEnumerable< TOutput > > > function,
KeyValuePair< TInput, long > messageWithId )
inlineprivate

Definition at line 188 of file TransformManyBlock.cs.

189 {
191 Exception ex = null;
192 try
193 {
194 task = function(messageWithId.Key);
195 }
196 catch (Exception ex2)
197 {
198 ex = ex2;
199 }
200 if (task == null)
201 {
202 if (ex != null && !Common.IsCooperativeCancellation(ex))
203 {
204 Common.StoreDataflowMessageValueIntoExceptionData(ex, messageWithId.Key);
206 }
207 if (_reorderingBuffer != null)
208 {
210 _target.SignalOneAsyncMessageCompleted();
211 }
212 else
213 {
214 _target.SignalOneAsyncMessageCompleted(-1);
215 }
216 }
217 else
218 {
220 {
222 tuple.Item1.AsyncCompleteProcessMessageWithTask(completed, tuple.Item2);
223 }, Tuple.Create(this, messageWithId), CancellationToken.None, Common.GetContinuationOptions(TaskContinuationOptions.ExecuteSynchronously), _source.DataflowBlockOptions.TaskScheduler);
224 }
225 }
static bool IsCooperativeCancellation(Exception exception)
Definition Common.cs:88
static TaskContinuationOptions GetContinuationOptions(TaskContinuationOptions toInclude=TaskContinuationOptions.None)
Definition Common.cs:262
readonly ReorderingBuffer< IEnumerable< TOutput > > _reorderingBuffer
void StoreOutputItems(KeyValuePair< TInput, long > messageWithId, IEnumerable< TOutput > outputItems)

References System.Threading.Tasks.Dataflow.TransformManyBlock< TInput, TOutput >._reorderingBuffer, System.Threading.Tasks.Dataflow.TransformManyBlock< TInput, TOutput >._source, System.Threading.Tasks.Dataflow.TransformManyBlock< TInput, TOutput >._target, System.Threading.Tasks.Dataflow.Internal.Common.GetContinuationOptions(), System.Threading.Tasks.Dataflow.Internal.Common.IsCooperativeCancellation(), System.Threading.CancellationToken.None, System.state, System.Threading.Tasks.Dataflow.TransformManyBlock< TInput, TOutput >.StoreOutputItems(), and System.task.