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

◆ Receive< TOutput >() [4/4]

static TOutput System.Threading.Tasks.Dataflow.DataflowBlock.Receive< TOutput > ( this ISourceBlock< TOutput > source,
TimeSpan timeout,
CancellationToken cancellationToken )
inlinestatic

Definition at line 1370 of file DataflowBlock.cs.

1371 {
1372 if (source == null)
1373 {
1374 throw new ArgumentNullException("source");
1375 }
1377 {
1378 throw new ArgumentOutOfRangeException("timeout", System.SR.ArgumentOutOfRange_NeedNonNegOrNegative1);
1379 }
1380 cancellationToken.ThrowIfCancellationRequested();
1382 {
1383 return item;
1384 }
1386 try
1387 {
1388 return task.GetAwaiter().GetResult();
1389 }
1390 catch
1391 {
1392 if (task.IsCanceled)
1393 {
1394 cancellationToken.ThrowIfCancellationRequested();
1395 }
1396 throw;
1397 }
1398 }
static string ArgumentOutOfRange_NeedNonNegOrNegative1
Definition SR.cs:1072
Definition SR.cs:7
static bool IsValidTimeout(TimeSpan timeout)
Definition Common.cs:252

References System.SR.ArgumentOutOfRange_NeedNonNegOrNegative1, System.cancellationToken, System.Threading.Tasks.Dataflow.Internal.Common.IsValidTimeout(), System.item, System.source, System.task, and System.timeout.