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

◆ WriteOnceBlock() [2/2]

System.Threading.Tasks.Dataflow.WriteOnceBlock< T >.WriteOnceBlock ( Func< T, T >? cloningFunction,
DataflowBlockOptions dataflowBlockOptions )
inline

Definition at line 89 of file WriteOnceBlock.cs.

90 {
91 if (dataflowBlockOptions == null)
92 {
93 throw new ArgumentNullException("dataflowBlockOptions");
94 }
98 if (dataflowBlockOptions.CancellationToken.CanBeCanceled)
99 {
101 if (dataflowBlockOptions.CancellationToken.IsCancellationRequested)
102 {
104 _lazyCompletionTaskSource.SetCanceled();
105 }
106 else
107 {
109 {
110 ((WriteOnceBlock<T>)state).Complete();
111 }, this);
112 }
113 }
115 if (log.IsEnabled())
116 {
117 log.DataflowBlockCreated(this, dataflowBlockOptions);
118 }
119 }
static void WireCancellationToComplete(CancellationToken cancellationToken, Task completionTask, Action< object > completeAction, object completeState)
Definition Common.cs:93
TaskCompletionSource< VoidResult > _lazyCompletionTaskSource
readonly DataflowBlockOptions _dataflowBlockOptions
readonly TargetRegistry< T > _targetRegistry

References System.Threading.Tasks.Dataflow.WriteOnceBlock< T >._cloningFunction, System.Threading.Tasks.Dataflow.WriteOnceBlock< T >._completionReserved, System.Threading.Tasks.Dataflow.WriteOnceBlock< T >._dataflowBlockOptions, System.Threading.Tasks.Dataflow.WriteOnceBlock< T >._decliningPermanently, System.Threading.Tasks.Dataflow.WriteOnceBlock< T >._lazyCompletionTaskSource, System.Threading.Tasks.Dataflow.WriteOnceBlock< T >._targetRegistry, System.Threading.Tasks.Dataflow.Internal.DataflowEtwProvider.Log, System.state, and System.Threading.Tasks.Dataflow.Internal.Common.WireCancellationToComplete().