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

◆ ActionBlock() [5/5]

Definition at line 172 of file ActionBlock.cs.

173 {
175 if ((object)action == null)
176 {
177 throw new ArgumentNullException("action");
178 }
179 if (dataflowBlockOptions == null)
180 {
181 throw new ArgumentNullException("dataflowBlockOptions");
182 }
185 if (syncAction != null && dataflowBlockOptions.SingleProducerConstrained && dataflowBlockOptions.MaxDegreeOfParallelism == 1 && !dataflowBlockOptions.CancellationToken.CanBeCanceled && dataflowBlockOptions.BoundedCapacity == -1)
186 {
188 }
189 else
190 {
191 if (syncAction != null)
192 {
194 {
195 actionBlock.ProcessMessage(syncAction, messageWithId);
196 }, null, dataflowBlockOptions, TargetCoreOptions.RepresentsBlockCompletion);
197 }
198 else
199 {
202 {
203 actionBlock.ProcessMessageWithTask(asyncAction, messageWithId);
204 }, null, dataflowBlockOptions, TargetCoreOptions.UsesAsyncCompletion | TargetCoreOptions.RepresentsBlockCompletion);
205 }
207 {
209 }, _defaultTarget);
210 }
212 if (log.IsEnabled())
213 {
214 log.DataflowBlockCreated(this, dataflowBlockOptions);
215 }
216 }
readonly SpscTargetCore< TInput > _spscTarget
readonly TargetCore< TInput > _defaultTarget
static void WireCancellationToComplete(CancellationToken cancellationToken, Task completionTask, Action< object > completeAction, object completeState)
Definition Common.cs:93

References System.Threading.Tasks.Dataflow.ActionBlock< TInput >._defaultTarget, System.Threading.Tasks.Dataflow.ActionBlock< TInput >._spscTarget, System.action, System.Threading.Tasks.Dataflow.ActionBlock< TInput >.Completion, System.Threading.Tasks.Dataflow.Internal.DataflowEtwProvider.Log, System.state, and System.Threading.Tasks.Dataflow.Internal.Common.WireCancellationToComplete().