11 [DebuggerDisplay(
"{DebuggerDisplayContent,nq}")]
41 return $"{Common.GetNameForDebugger(this)} Source=\"{((debuggerDisplay != null) ? debuggerDisplay.Content : _source)}\", Target=\"{((debuggerDisplay2 != null) ? debuggerDisplay2.Content : _target)}\"";
107 [DebuggerDisplay(
"{DebuggerDisplayContent,nq}")]
146 return $"{Common.GetNameForDebugger(this)} Message={_messageValue}, Target=\"{((debuggerDisplay != null) ? debuggerDisplay.Content : _target)}\"";
310 if (
base.Task.IsCompleted)
313 return default(TOutput);
326 return default(TOutput);
339 if (
base.Task.IsCompleted)
368 if (
base.Task.IsCompleted)
412 [DebuggerDisplay(
"{DebuggerDisplayContent,nq}")]
641 [DebuggerDisplay(
"{DebuggerDisplayContent,nq}")]
718 [DebuggerDisplay(
"{DebuggerDisplayContent,nq}")]
748 return $"{Common.GetNameForDebugger(this)} Target=\"{((debuggerDisplay != null) ? debuggerDisplay.Content : _target)}\", Source=\"{((debuggerDisplay2 != null) ? debuggerDisplay2.Content : _source)}\"";
790 item =
default(TOutput);
820 [DebuggerDisplay(
"{DebuggerDisplayContent,nq}")]
882 _completed.Value =
base.Task;
901 [DebuggerDisplay(
"{DebuggerDisplayContent,nq}")]
1022 item2.OnCompleted();
1045 return $"Observers={_observersState.Observers.Count}, Block=\"{((debuggerDisplay != null) ? debuggerDisplay.Content : _source)}\"";
1142 [DebuggerDisplay(
"{DebuggerDisplayContent,nq}")]
1152 return $"Block=\"{((debuggerDisplay != null) ? debuggerDisplay.Content : _target)}\"";
1166 task.GetAwaiter().GetResult();
1263 if (predicate ==
null)
1311 Common.StoreDataflowMessageValueIntoExceptionData(
ex,
item);
1312 return Common.CreateTaskFromException<
bool>(
ex);
1388 return task.GetAwaiter().GetResult();
1392 if (
task.IsCanceled)
1420 int num = (int)
timeout.TotalMilliseconds;
1588 if (
TryChooseFromSource(
source1,
action1, 0,
taskScheduler,
out var task) ||
TryChooseFromSource(
source2,
action2, 1,
taskScheduler,
out task) || (flag &&
TryChooseFromSource(
source3,
action3, 2,
taskScheduler,
out task)))
1631 switch (
task.Status)
1633 case TaskStatus.Faulted:
1634 Common.AddException(ref list, task.Exception, unwrapInnerExceptions: true);
1636 case TaskStatus.RanToCompletion:
1638 int result2 = task.Result;
1649 result.TrySetException(
list);
1653 result.TrySetResult(num);
1657 result.TrySetCanceled();
1666 if (
cts.IsCancellationRequested)
1668 return Common.CreateTaskFromCancellation<
int>(
cts.Token);
bool ICollection< KeyValuePair< TKey, TValue > >. Remove(KeyValuePair< TKey, TValue > keyValuePair)
bool ICollection< KeyValuePair< TKey, TValue > >. Contains(KeyValuePair< TKey, TValue > keyValuePair)
void Add(TKey key, TValue value)
static bool HasShutdownStarted
static void SuppressFinalize(object obj)
static string Argument_InvalidMessageHeader
static string InvalidOperation_MessageNotReservedByTarget
static string NotSupported_MemberNotNeeded
static string InvalidOperation_DataNotAvailableForReceive
static string ArgumentOutOfRange_NeedNonNegOrNegative1
static string InvalidOperation_ErrorDuringCleanup
static string Argument_CantConsumeFromANullSource
static CancellationTokenSource CreateLinkedTokenSource(CancellationToken token1, CancellationToken token2)
bool IsCancellationRequested
static int CompareExchange(ref int location1, int value, int comparand)
static readonly DataflowBlockOptions Default
readonly StrongBox< Task > _completed
static readonly Func< object, int > s_processBranchFunction
DataflowMessageStatus OfferMessage(DataflowMessageHeader messageHeader, T messageValue, ISourceBlock< T > source, bool consumeToAccept)
ChooseTarget(StrongBox< Task > completed, CancellationToken cancellationToken)
object DebuggerDisplayContent
readonly EncapsulatingPropagator< TInput, TOutput > _propagator
ISourceBlock< TOutput > Source
ITargetBlock< TInput > Target
DebugView(EncapsulatingPropagator< TInput, TOutput > propagator)
TOutput ConsumeMessage(DataflowMessageHeader messageHeader, ITargetBlock< TOutput > target, out bool messageConsumed)
bool TryReceive(Predicate< TOutput > filter, [MaybeNullWhen(false)] out TOutput item)
bool ReserveMessage(DataflowMessageHeader messageHeader, ITargetBlock< TOutput > target)
void ReleaseReservation(DataflowMessageHeader messageHeader, ITargetBlock< TOutput > target)
object DebuggerDisplayContent
bool TryReceiveAll([NotNullWhen(true)] out IList< TOutput > items)
DataflowMessageStatus OfferMessage(DataflowMessageHeader messageHeader, TInput messageValue, ISourceBlock< TInput > source, bool consumeToAccept)
readonly ISourceBlock< TOutput > _source
readonly ITargetBlock< TInput > _target
IDisposable LinkTo(ITargetBlock< TOutput > target, DataflowLinkOptions linkOptions)
EncapsulatingPropagator(ITargetBlock< TInput > target, ISourceBlock< TOutput > source)
ITargetBlock< T > LinkedTarget
DebugView(FilteredLinkPropagator< T > filter)
readonly FilteredLinkPropagator< T > _filter
readonly ISourceBlock< T > _source
bool RunPredicate(T item)
readonly Predicate< T > _userProvidedPredicate
FilteredLinkPropagator(ISourceBlock< T > source, ITargetBlock< T > target, Predicate< T > predicate)
object DebuggerDisplayContent
readonly ITargetBlock< T > _target
CancellationTokenRegistration _ctr
static void CancelAndUnlink(object state)
static readonly Action< object > s_cancelAndUnlink
void AttemptThreadSafeUnlink()
static readonly Func< Task< bool >, object, bool > s_handleCompletion
object DebuggerDisplayContent
static Exception CreateExceptionForTimeout()
static Exception CreateExceptionForSourceCompletion()
static readonly Action< object > CachedLinkingCancellationCallback
Exception _receivedException
static readonly TimerCallback CachedLinkingTimerCallback
void CleanupAndComplete(ReceiveCoreByLinkingCleanupReason reason)
object DebuggerDisplayContent
CancellationToken _externalCancellationToken
bool TryCleanupAndComplete(ReceiveCoreByLinkingCleanupReason reason)
readonly CancellationTokenSource _cts
CancellationTokenRegistration _regFromExternalCancellationToken
DebugView(SendAsyncSource< TOutput > source)
readonly SendAsyncSource< TOutput > _source
ITargetBlock< TOutput > Target
void CompleteAsDeclined(bool runAsync)
static void CancellationHandler(object state)
readonly ITargetBlock< TOutput > _target
object DebuggerDisplayContent
void RunCompletionAction(Action< object > completionAction, object completionActionState, bool runAsync)
SendAsyncSource(ITargetBlock< TOutput > target, TOutput messageValue, CancellationToken cancellationToken)
void CompleteAsAccepted(bool runAsync)
readonly TOutput _messageValue
void CompleteAsFaulted(Exception exception, bool runAsync)
CancellationToken _cancellationToken
void CompleteAsCanceled(bool runAsync)
CancellationTokenRegistration _cancellationRegistration
void OfferToTargetAsync()
static readonly Action< object > _cancellationCallback
IObserver< TOutput >[] Observers
readonly SourceObservable< TOutput > _observable
DebugView(SourceObservable< TOutput > observable)
readonly ISourceBlock< TOutput > _source
readonly object _SubscriptionLock
SourceObservable(ISourceBlock< TOutput > source)
ObserversState _observersState
static IObservable< TOutput > From(ISourceBlock< TOutput > source)
static readonly ConditionalWeakTable< ISourceBlock< TOutput >, SourceObservable< TOutput > > _table
object DebuggerDisplayContent
ImmutableArray< IObserver< TOutput > > ResetObserverState()
void Unsubscribe(IObserver< TOutput > observer)
AggregateException GetCompletionError()
TargetObserver(ITargetBlock< TInput > target)
Task< bool > SendAsyncToTarget(TInput value)
object DebuggerDisplayContent
readonly ITargetBlock< TInput > _target
static Task< TOutput > ReceiveCoreByLinking< TOutput >(ISourceBlock< TOutput > source, int millisecondsTimeout, CancellationToken cancellationToken)
static Task< int > ChooseCore< T1, T2, T3 >(ISourceBlock< T1 > source1, Action< T1 > action1, ISourceBlock< T2 > source2, Action< T2 > action2, ISourceBlock< T3 > source3, Action< T3 > action3, DataflowBlockOptions dataflowBlockOptions)
static Task< int > ChooseCoreByLinking< T1, T2, T3 >(ISourceBlock< T1 > source1, Action< T1 > action1, ISourceBlock< T2 > source2, Action< T2 > action2, ISourceBlock< T3 > source3, Action< T3 > action3, DataflowBlockOptions dataflowBlockOptions)
ReceiveCoreByLinkingCleanupReason
static Task< bool > SendAsync< TInput >(this ITargetBlock< TInput > target, TInput item)
static Task< int > Choose< T1, T2 >(ISourceBlock< T1 > source1, Action< T1 > action1, ISourceBlock< T2 > source2, Action< T2 > action2)
static readonly Action< object > _cancelCts
static IDisposable LinkTo< TOutput >(this ISourceBlock< TOutput > source, ITargetBlock< TOutput > target)
static bool Post< TInput >(this ITargetBlock< TInput > target, TInput item)
static TOutput Receive< TOutput >(this ISourceBlock< TOutput > source)
static Task< TOutput > ReceiveCore< TOutput >(this ISourceBlock< TOutput > source, bool attemptTryReceive, TimeSpan timeout, CancellationToken cancellationToken)
static bool TryChooseFromSource< T >(ISourceBlock< T > source, Action< T > action, int branchId, TaskScheduler scheduler, [NotNullWhen(true)] out Task< int > task)
static bool TryReceive< TOutput >(this IReceivableSourceBlock< TOutput > source, [MaybeNullWhen(false)] out TOutput item)
static Task< TOutput > ReceiveAsync< TOutput >(this ISourceBlock< TOutput > source)
static IPropagatorBlock< TInput, TOutput > Encapsulate< TInput, TOutput >(ITargetBlock< TInput > target, ISourceBlock< TOutput > source)
static Task< bool > OutputAvailableAsync< TOutput >(this ISourceBlock< TOutput > source)
static readonly ExecutionDataflowBlockOptions _nonGreedyExecutionOptions
static Task< int > Choose< T1, T2, T3 >(ISourceBlock< T1 > source1, Action< T1 > action1, ISourceBlock< T2 > source2, Action< T2 > action2, ISourceBlock< T3 > source3, Action< T3 > action3)
static readonly DataflowLinkOptions Default
static readonly DataflowLinkOptions UnlinkAfterOneAndPropagateCompletion
static void ThrowAsync(Exception error)
static readonly Task< bool > CompletedTaskWithFalseResult
static Task GetPotentiallyNotSupportedCompletionTask(IDataflowBlock block)
static TaskContinuationOptions GetContinuationOptions(TaskContinuationOptions toInclude=TaskContinuationOptions.None)
static bool IsValidTimeout(TimeSpan timeout)
static readonly Task< bool > CompletedTaskWithTrueResult
static TaskCreationOptions GetCreationOptionsForTask(bool isReplacementReplica=false)
static readonly DataflowMessageHeader SingleMessageHeader
static Exception InitializeStackTrace(Exception exception)
static void WireCancellationToComplete(CancellationToken cancellationToken, Task completionTask, Action< object > completeAction, object completeState)
static readonly TimeSpan InfiniteTimeSpan
static readonly IDisposable Nop
static TaskScheduler Default
Task ContinueWith(Action< Task< TResult > > continuationAction)
static new TaskFactory< TResult > Factory
AggregateException? Exception
static Task WhenAll(IEnumerable< Task > tasks)
bool Dispose(WaitHandle notifyObject)
static bool Read(ref bool location)
void Fault(Exception exception)
bool ReserveMessage(DataflowMessageHeader messageHeader, ITargetBlock< TOutput > target)
IDisposable LinkTo(ITargetBlock< TOutput > target, DataflowLinkOptions linkOptions)
void ReleaseReservation(DataflowMessageHeader messageHeader, ITargetBlock< TOutput > target)
TOutput? ConsumeMessage(DataflowMessageHeader messageHeader, ITargetBlock< TOutput > target, out bool messageConsumed)
DataflowMessageStatus OfferMessage(DataflowMessageHeader messageHeader, TInput messageValue, ISourceBlock< TInput >? source, bool consumeToAccept)
delegate void TimerCallback(object? state)
bool IsCancellationRequested
static CancellationToken None