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

◆ ProcessMessageWithTask()

void System.Threading.Tasks.Dataflow.ActionBlock< TInput >.ProcessMessageWithTask ( Func< TInput, Task > action,
KeyValuePair< TInput, long > messageWithId )
inlineprivate

Definition at line 240 of file ActionBlock.cs.

241 {
242 Task task = null;
243 Exception ex = null;
244 try
245 {
247 }
248 catch (Exception ex2)
249 {
250 ex = ex2;
251 }
252 if (task == null)
253 {
254 if (ex != null && !Common.IsCooperativeCancellation(ex))
255 {
256 Common.StoreDataflowMessageValueIntoExceptionData(ex, messageWithId.Key);
258 }
259 _defaultTarget.SignalOneAsyncMessageCompleted(-1);
260 }
261 else if (task.IsCompleted)
262 {
264 }
265 else
266 {
267 task.ContinueWith(delegate(Task completed, object state)
268 {
269 ((ActionBlock<TInput>)state).AsyncCompleteProcessMessageWithTask(completed);
270 }, this, CancellationToken.None, Common.GetContinuationOptions(TaskContinuationOptions.ExecuteSynchronously), TaskScheduler.Default);
271 }
272 }
void AsyncCompleteProcessMessageWithTask(Task completed)
readonly TargetCore< TInput > _defaultTarget
static bool IsCooperativeCancellation(Exception exception)
Definition Common.cs:88
static TaskContinuationOptions GetContinuationOptions(TaskContinuationOptions toInclude=TaskContinuationOptions.None)
Definition Common.cs:262

References System.Threading.Tasks.Dataflow.ActionBlock< TInput >._defaultTarget, System.action, System.Threading.Tasks.Dataflow.ActionBlock< TInput >.AsyncCompleteProcessMessageWithTask(), System.Threading.Tasks.TaskScheduler.Default, System.Threading.Tasks.Dataflow.Internal.Common.GetContinuationOptions(), System.Threading.Tasks.Dataflow.Internal.Common.IsCooperativeCancellation(), System.Threading.CancellationToken.None, System.state, and System.task.