4 writes to Writer
System.Threading.Channels (4)
System\Threading\Channels\BoundedChannel.cs (1)
55Writer = new BoundedChannelWriter(this);
System\Threading\Channels\SingleConsumerUnboundedChannel.cs (1)
48Writer = new UnboundedChannelWriter(this);
System\Threading\Channels\UnboundedChannel.cs (1)
37Writer = new UnboundedChannelWriter(this);
System\Threading\Channels\UnboundedPriorityChannel.cs (1)
42Writer = new UnboundedPrioritizedChannelWriter(this);
215 references to Writer
Aspire.Components.Common.Tests (2)
ActivityNotifier.cs (2)
36_activityChannel.Writer.TryWrite(data); 51_activityChannel.Writer.TryComplete();
Aspire.Confluent.Kafka (1)
MetricsChannel.cs (1)
24public ChannelWriter<string> Writer => _channel.Writer;
Aspire.Dashboard (2)
ResourceService\DashboardClient.cs (2)
503channel.Writer.TryWrite(logLines); 508channel.Writer.TryComplete();
Aspire.Dashboard.Components.Tests (4)
Pages\ConsoleLogsTests.cs (4)
69resourceChannel.Writer.TryWrite([ 81consoleLogsChannel.Writer.TryWrite([new ResourceLogLine(1, "Test content", IsErrorMessage: false)]); 82consoleLogsChannel.Writer.Complete(); 134consoleLogsChannel.Writer.TryWrite([new ResourceLogLine(1, "Hello world", IsErrorMessage: false)]);
Aspire.Dashboard.Tests (14)
ChannelExtensionsTests.cs (11)
21channel.Writer.TryWrite(["a", "b", "c"]); 45channel.Writer.TryWrite(["a", "b", "c"]); 71channel.Writer.TryWrite(["a", "b", "c"]); 80resultChannel.Writer.TryWrite(batch); 85resultChannel.Writer.Complete(); 94channel.Writer.TryWrite(["d", "e", "f"]); 102channel.Writer.Complete(); 115channel.Writer.TryWrite(["a", "b", "c"]); 124resultChannel.Writer.TryWrite(batch); 129resultChannel.Writer.Complete(); 138channel.Writer.TryWrite(["d", "e", "f"]);
ResourceOutgoingPeerResolverTests.cs (2)
130await resultChannel.Writer.WriteAsync(changeCount++); 146await sourceChannel.Writer.WriteAsync(new ResourceViewModelChange(ResourceViewModelChangeType.Upsert, CreateResource("test2")));
TelemetryRepositoryTests\LogTests.cs (1)
725resultChannel.Writer.TryWrite(callCount);
Aspire.Hosting (13)
ApplicationModel\ResourceLoggerService.cs (6)
175channel.Writer.TryWrite(logLines); 187channel.Writer.Complete(); 229channel.Writer.TryWrite(new(name, hasSubscribers)); 367using var _ = _logStreamCts.Token.Register(() => channel.Writer.TryComplete()); 370void Log(LogEntry log) => channel.Writer.TryWrite(log); 408channel.Writer.TryComplete();
ApplicationModel\ResourceNotificationService.cs (2)
313channel.Writer.TryWrite(resourceEvent); 334channel.Writer.TryComplete();
Dashboard\ResourcePublisher.cs (1)
106await channel.Writer.WriteAsync(new(changeType, snapshot), cancellationToken).ConfigureAwait(false);
Dcp\ResourceLogSource.cs (4)
62channel.Writer.TryComplete(); 85var succeeded = channel.Writer.TryWrite((line, isError)); 89channel.Writer.TryComplete(); 101channel.Writer.TryComplete(ex);
Aspire.Hosting.Tests (11)
Dashboard\DashboardLifecycleHookTests.cs (1)
39testSink.MessageLogged += c => logChannel.Writer.TryWrite(c);
Dcp\ApplicationExecutorTests.cs (2)
449if (!logStreamPipesChannel.Writer.TryWrite((logStreamType, s))) 637logStreamPipesChannel.Writer.Complete();
Dcp\TestKubernetesService.cs (3)
73c.Writer.TryWrite((WatchEventType.Added, res)); 86c.Writer.TryWrite((WatchEventType.Modified, resource)); 113chan.Writer.TryWrite((WatchEventType.Added, res));
Health\ResourceHealthCheckServiceTests.cs (1)
141await channel.Writer.WriteAsync(timeProvider.GetUtcNow());
Utils\Grpc\TestAsyncStreamReader.cs (2)
24if (!_channel.Writer.TryWrite(message)) 32_channel.Writer.Complete();
Utils\Grpc\TestServerStreamWriter.cs (2)
25_channel.Writer.Complete(); 52if (!_channel.Writer.TryWrite(message))
ClientSample (5)
UploadSample.cs (5)
49await channel.Writer.WriteAsync(c.ToString()); 52channel.Writer.TryComplete(); 62_ = WriteItemsAsync(channel_one.Writer, new[] { 2, 2, 3 }); 63_ = WriteItemsAsync(channel_two.Writer, new[] { -2, 5, 3 }); 91await channel.Writer.WriteAsync(phrase);
InMemory.FunctionalTests (9)
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (7)
297var success = _http3TestBase._serverReceivedSettings.Writer.TryWrite( 411MultiplexedConnectionContext.ToServerAcceptQueue.Writer.TryWrite(stream.StreamContext); 435MultiplexedConnectionContext.ToServerAcceptQueue.Writer.TryWrite(stream.StreamContext); 453MultiplexedConnectionContext.ToServerAcceptQueue.Writer.TryWrite(stream.StreamContext); 1047ToServerAcceptQueue.Writer.TryComplete(); 1048ToClientAcceptQueue.Writer.TryComplete(); 1077ToClientAcceptQueue.Writer.WriteAsync(stream);
TestTransport\InMemoryTransportFactory.cs (2)
21_acceptQueue.Writer.TryWrite(connection); 52_acceptQueue.Writer.TryComplete();
Microsoft.AspNetCore.ConcurrencyLimiter.Tests (2)
src\Shared\EventSource.Testing\TestCounterListener.cs (2)
55var writer = _counters[counter].Writer; 65item.Value.Writer.TryComplete();
Microsoft.AspNetCore.Hosting.Tests (2)
src\Shared\EventSource.Testing\TestCounterListener.cs (2)
55var writer = _counters[counter].Writer; 65item.Value.Writer.TryComplete();
Microsoft.AspNetCore.Http.Connections.Tests (2)
TestWebSocketConnectionFeature.cs (2)
43var clientSocket = new WebSocketChannel(serverToClient.Reader, clientToServer.Writer, _sync); 44var serverSocket = new WebSocketChannel(clientToServer.Reader, serverToClient.Writer, _sync);
Microsoft.AspNetCore.Server.Kestrel.Core (5)
Internal\Http2\Http2FrameWriter.cs (2)
166if (!_channel.Writer.TryWrite(producer)) 453_channel.Writer.TryComplete();
Internal\WebTransport\WebTransportSession.cs (3)
88_pendingStreams.Writer.Complete(); 119_pendingStreams.Writer.Complete(); 155if (!addedToOpenStreams || !_pendingStreams.Writer.TryWrite(stream))
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (7)
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (7)
297var success = _http3TestBase._serverReceivedSettings.Writer.TryWrite( 411MultiplexedConnectionContext.ToServerAcceptQueue.Writer.TryWrite(stream.StreamContext); 435MultiplexedConnectionContext.ToServerAcceptQueue.Writer.TryWrite(stream.StreamContext); 453MultiplexedConnectionContext.ToServerAcceptQueue.Writer.TryWrite(stream.StreamContext); 1047ToServerAcceptQueue.Writer.TryComplete(); 1048ToClientAcceptQueue.Writer.TryComplete(); 1077ToClientAcceptQueue.Writer.WriteAsync(stream);
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (4)
Internal\NamedPipeConnectionListener.cs (4)
89_acceptedQueue.Writer.TryComplete(); 93_acceptedQueue.Writer.TryComplete(ex); 119while (!_acceptedQueue.Writer.TryWrite(connection)) 121if (!await _acceptedQueue.Writer.WaitToWriteAsync(_listeningToken))
Microsoft.AspNetCore.SignalR.Client.Core (13)
HubConnection.cs (2)
1649closeMessage = await ProcessMessagesAsync(message, connectionState, invocationMessageChannel.Writer).ConfigureAwait(false); 1701invocationMessageChannel.Writer.TryComplete();
HubConnectionExtensions.StreamAsChannelAsync.cs (4)
295while (!outputChannel.Writer.TryWrite((TResult)item!)) 297if (!await outputChannel.Writer.WaitToWriteAsync().ConfigureAwait(false)) 308outputChannel.Writer.TryComplete(ex); 313outputChannel.Writer.TryComplete();
Internal\InvocationRequest.cs (6)
103_channel.Writer.TryComplete(new InvalidOperationException("Server provided a result in a completion response to a streamed invocation.")); 118_channel.Writer.TryComplete(); 132_channel.Writer.TryComplete(exception); 139while (!_channel.Writer.TryWrite(item)) 141if (!await _channel.Writer.WaitToWriteAsync().ConfigureAwait(false)) 163_channel.Writer.TryComplete(new OperationCanceledException());
src\SignalR\common\Shared\MessageBuffer.cs (1)
206_waitForAck.Writer.TryWrite(newCount);
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (18)
HubConnectionTests.cs (5)
802await channelWriter.Writer.WriteAsync("1").AsTask().DefaultTimeout(); 804await channelWriter.Writer.WriteAsync("2").AsTask().DefaultTimeout(); 806channelWriter.Writer.Complete(); 2945_taskQueue.Writer.TryWrite((d, state)); 2951_taskQueue.Writer.Complete();
HubConnectionTests.Tracing.cs (7)
48clientChannel.Writer.TryWrite(activity); 52serverChannel.Writer.TryWrite(activity); 247serverChannel.Writer.TryWrite(activity); 391serverChannel.Writer.TryWrite(activity); 494serverChannel.Writer.TryWrite(activity); 590serverChannel.Writer.TryWrite(activity); 680serverChannel.Writer.TryWrite(activity);
Hubs.cs (6)
233await channel.Writer.WriteAsync(i); 237channel.Writer.TryComplete(); 261await output.Writer.WriteAsync(item); 267output.Writer.TryComplete(); 285await output.Writer.WriteAsync(item); 291output.Writer.TryComplete();
Microsoft.AspNetCore.SignalR.Client.Tests (9)
HubConnectionTests.cs (9)
448await channel.Writer.WriteAsync(number).AsTask().DefaultTimeout(); 456channel.Writer.TryComplete(); 489await channel.Writer.WriteAsync(item); 520await channel.Writer.WriteAsync(item); 528channel.Writer.TryComplete(); 565await channel.Writer.WriteAsync(number); 592channel.Writer.Complete(new Exception("error from client")); 685await channel.Writer.WriteAsync(5); 686await channel.Writer.WriteAsync(10);
Microsoft.AspNetCore.SignalR.Core (5)
Internal\ChannelBasedSemaphore.cs (2)
20_channel.Writer.TryWrite(1); 37if (!_channel.Writer.TryWrite(1))
src\SignalR\common\Shared\MessageBuffer.cs (1)
206_waitForAck.Writer.TryWrite(newCount);
StreamTracker.cs (2)
134return _channel.Writer.WriteAsync((T?)o).AsTask(); 139_channel.Writer.TryComplete(ex);
Microsoft.AspNetCore.SignalR.Microbenchmarks (5)
DefaultHubDispatcherBenchmark.cs (5)
137channel.Writer.Complete(); 145channel.Writer.Complete(); 153channel.Writer.Complete(); 166await channel.Writer.WriteAsync(i); 168channel.Writer.Complete();
Microsoft.AspNetCore.SignalR.Tests (35)
HubConnectionHandlerTests.Activity.cs (8)
40ActivityStarted = a => serverChannel.Writer.TryWrite(a) 115ActivityStarted = a => serverChannel.Writer.TryWrite(a) 184ActivityStarted = a => serverChannel.Writer.TryWrite(a) 243ActivityStarted = a => serverChannel.Writer.TryWrite(a) 316ActivityStarted = a => serverChannel.Writer.TryWrite(a) 363ActivityStarted = a => serverChannel.Writer.TryWrite(a) 415ActivityStarted = a => serverChannel.Writer.TryWrite(a) 466ActivityStarted = a => serverChannel.Writer.TryWrite(a)
HubConnectionHandlerTestUtils\Hubs.cs (15)
294_ = ChannelFunc(channel.Writer, source); 710await channel.Writer.WriteAsync(i.ToString(CultureInfo.InvariantCulture)); 712channel.Writer.Complete(); 779channel.Writer.TryComplete(new Exception("Exception from channel")); 786channel.Writer.TryComplete(new ChannelClosedException("ChannelClosedException from channel")); 793channel.Writer.TryComplete(new ChannelClosedException(new Exception("ChannelClosedException from channel"))); 822await output.Writer.WriteAsync("echo:" + item); 826output.Writer.TryComplete(); 1041channel.Writer.TryComplete(); 1056channel.Writer.TryComplete(); 1071channel.Writer.TryComplete(); 1085channel.Writer.TryComplete(); 1101channel.Writer.TryComplete(); 1138await channel.Writer.WriteAsync(i); 1142channel.Writer.TryComplete();
NativeAotTests.cs (12)
81await channel.Writer.WriteAsync("some data"); 82await channel.Writer.WriteAsync("some more data"); 83await channel.Writer.WriteAsync("even more data"); 84channel.Writer.Complete(); 113await channelShorts.Writer.WriteAsync(9); 114await channelShorts.Writer.WriteAsync(8); 115await channelShorts.Writer.WriteAsync(7); 116channelShorts.Writer.Complete(); 255await output.Writer.WriteAsync("echo:" + item); 258output.Writer.TryComplete(); 289await output.Writer.WriteAsync(item); 292output.Writer.TryComplete();
Microsoft.CodeAnalysis.CodeStyle (5)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IAsyncEnumerableExtensions.cs (2)
63tasks[i] = ProcessAsync(streams[i], channel.Writer, cancellationToken); 100static (task, channel) => ((Channel<T>)channel!).Writer.Complete(task.Exception),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\ProducerConsumer.cs (3)
296() => channel.Writer.TryComplete(new OperationCanceledException(cancellationToken))); 322await produceItems(item => channel.Writer.TryWrite(item), args, cancellationToken).ConfigureAwait(false); 332channel.Writer.TryComplete(exception);
Microsoft.CodeAnalysis.Workspaces (5)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IAsyncEnumerableExtensions.cs (2)
63tasks[i] = ProcessAsync(streams[i], channel.Writer, cancellationToken); 100static (task, channel) => ((Channel<T>)channel!).Writer.Complete(task.Exception),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\ProducerConsumer.cs (3)
296() => channel.Writer.TryComplete(new OperationCanceledException(cancellationToken))); 322await produceItems(item => channel.Writer.TryWrite(item), args, cancellationToken).ConfigureAwait(false); 332channel.Writer.TryComplete(exception);
Microsoft.Extensions.AI (2)
ChatCompletion\AnonymousDelegatingChatClient.cs (2)
143await updates.Writer.WriteAsync(update, cancellationToken).ConfigureAwait(false); 154_ = updates.Writer.TryComplete(error);
Microsoft.Extensions.ServiceDiscovery.Tests (1)
ServiceEndpointResolverTests.cs (1)
265watcher.OnEndpointsUpdated = result => channel.Writer.TryWrite(result);
Microsoft.ML.Data (1)
Transforms\RowShufflingTransformer.cs (1)
557bool retval = target.Writer.TryWrite(item);
Microsoft.ML.Sweeper (2)
AsyncSweeper.cs (2)
224_paramChannel.Writer.Complete(); 229_paramChannel.Writer.TryWrite(new ParameterSetWithId(_numGenerated++, paramSet));
SignalR.Client.FunctionalTestApp (5)
TestHub.cs (5)
63channel.Writer.TryWrite("a"); 64channel.Writer.TryWrite("b"); 65channel.Writer.TryWrite("c"); 66channel.Writer.Complete(); 101channel.Writer.Complete();
SignalRSamples (8)
Hubs\Streaming.cs (2)
38await channel.Writer.WriteAsync(i); 42channel.Writer.TryComplete();
Hubs\UploadHub.cs (2)
74await output.Writer.WriteAsync("echo:" + item); 77output.Writer.Complete();
ObservableExtensions.cs (4)
29value => channel.Writer.TryWrite(value), 30error => channel.Writer.TryComplete(error), 31() => channel.Writer.TryComplete()); 32var abortRegistration = connectionAborted.Register(() => channel.Writer.TryComplete());
Stress.ApiService (4)
ProducerConsumer.cs (2)
63await _channel.Writer.WriteAsync(data); 65_channel.Writer.Complete();
Program.cs (2)
157channel.Writer.TryWrite($"Logged {logCount} messages."); 163channel.Writer.Complete();
System.Net.Http (2)
System\Net\Http\SocketsHttpHandler\Http2Connection.cs (2)
1176if (!_writeChannel.Writer.TryWrite(writeEntry)) 1848bool completed = _writeChannel.Writer.TryComplete();
System.Net.Quic (9)
System\Net\Quic\QuicConnection.cs (5)
662_acceptQueue.Writer.TryComplete(exception); 669_acceptQueue.Writer.TryComplete(exception); 679_acceptQueue.Writer.TryComplete(exception); 705if (!_acceptQueue.Writer.TryWrite(stream)) 863_acceptQueue.Writer.TryComplete(ExceptionDispatchInfo.SetCurrentStackTrace(new ObjectDisposedException(GetType().FullName)));
System\Net\Quic\QuicListener.cs (4)
246if (!_acceptQueue.Writer.TryWrite(connection)) 278if (!_acceptQueue.Writer.TryWrite(ex)) 313if (!_acceptQueue.Writer.TryWrite( 433_acceptQueue.Writer.TryComplete(ExceptionDispatchInfo.SetCurrentStackTrace(new ObjectDisposedException(GetType().FullName)));
System.Threading.Channels (1)
System\Threading\Channels\Channel_2.cs (1)
26public static implicit operator ChannelWriter<TWrite>(Channel<TWrite, TRead> channel) => channel.Writer;
TestDiscoveryWorker (2)
Program.cs (2)
138_channel.Writer.Complete(); 148if (!_channel.Writer.TryWrite(fullName))