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

◆ WriteAsync()

override ValueTask System.Threading.Channels.UnboundedChannel< T >.UnboundedChannelWriter.WriteAsync ( T item,
CancellationToken cancellationToken )
inlinevirtual

Reimplemented from System.Threading.Channels.ChannelWriter< T >.

Definition at line 238 of file UnboundedChannel.cs.

239 {
240 if (!cancellationToken.IsCancellationRequested)
241 {
242 if (!TryWrite(item))
243 {
244 return new ValueTask(Task.FromException(ChannelUtilities.CreateInvalidCompletionException(_parent._doneWriting)));
245 }
246 return default(ValueTask);
247 }
249 }
static Task FromException(Exception exception)
Definition Task.cs:3341
static Task FromCanceled(CancellationToken cancellationToken)
Definition Task.cs:3363

References System.Threading.Channels.UnboundedChannel< T >.UnboundedChannelWriter._parent, System.cancellationToken, System.Threading.Channels.ChannelUtilities.CreateInvalidCompletionException(), System.Threading.Tasks.Task< TResult >.FromCanceled(), System.Threading.Tasks.Task< TResult >.FromException(), System.item, and System.Threading.Channels.UnboundedChannel< T >.UnboundedChannelWriter.TryWrite().