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

◆ AsyncCompleteProcessMessageWithTask()

void System.Threading.Tasks.Dataflow.TransformBlock< TInput, TOutput >.AsyncCompleteProcessMessageWithTask ( Task< TOutput > completed,
KeyValuePair< TInput, long > messageWithId )
inlineprivate

Definition at line 243 of file TransformBlock.cs.

244 {
245 bool isBounded = _target.IsBounded;
246 bool flag = false;
247 TOutput item = default(TOutput);
248 switch (completed.Status)
249 {
250 case TaskStatus.RanToCompletion:
251 item = completed.Result;
252 flag = true;
253 break;
254 case TaskStatus.Faulted:
255 {
256 AggregateException exception = completed.Exception;
257 Common.StoreDataflowMessageValueIntoExceptionData(exception, messageWithId.Key, targetInnerExceptions: true);
259 break;
260 }
261 }
262 if (!flag && isBounded)
263 {
264 _target.ChangeBoundingCount(-1);
265 }
266 if (_reorderingBuffer == null)
267 {
268 if (flag)
269 {
270 if (_target.DataflowBlockOptions.MaxDegreeOfParallelism == 1)
271 {
272 _source.AddMessage(item);
273 }
274 else
275 {
277 {
278 _source.AddMessage(item);
279 }
280 }
281 }
282 }
283 else
284 {
285 _reorderingBuffer.AddItem(messageWithId.Value, item, flag);
286 }
287 _target.SignalOneAsyncMessageCompleted();
288 }
readonly ReorderingBuffer< TOutput > _reorderingBuffer

References System.Threading.Tasks.Dataflow.TransformBlock< TInput, TOutput >._reorderingBuffer, System.Threading.Tasks.Dataflow.TransformBlock< TInput, TOutput >._source, System.Threading.Tasks.Dataflow.TransformBlock< TInput, TOutput >._target, System.exception, System.item, and System.Threading.Tasks.Dataflow.TransformBlock< TInput, TOutput >.ParallelSourceLock.