4 writes to Reader
System.Threading.Channels (4)
System\Threading\Channels\BoundedChannel.cs (1)
54Reader = new BoundedChannelReader(this);
System\Threading\Channels\SingleConsumerUnboundedChannel.cs (1)
47Reader = new UnboundedChannelReader(this);
System\Threading\Channels\UnboundedChannel.cs (1)
36Reader = new UnboundedChannelReader(this);
System\Threading\Channels\UnboundedPriorityChannel.cs (1)
41Reader = new UnboundedPrioritizedChannelReader(this);
168 references to Reader
Aspire.Components.Common.Tests (1)
ActivityNotifier.cs (1)
41await foreach (var activity in _activityChannel.Reader.ReadAllAsync(cancellationToken).ConfigureAwait(false))
Aspire.Confluent.Kafka (1)
MetricsChannel.cs (1)
23public ChannelReader<string> Reader => _channel.Reader;
Aspire.Dashboard (2)
src\Shared\ChannelExtensions.cs (2)
36if (await channel.Reader.WaitToReadAsync(cancellationToken).ConfigureAwait(false)) 48while (!cancellationToken.IsCancellationRequested && channel.Reader.TryRead(out var log))
Aspire.Dashboard.Components.Tests (2)
Shared\TestDashboardClient.cs (2)
52await foreach (var item in channel.Reader.ReadAllAsync(cancellationToken)) 71await foreach (var item in channel.Reader.ReadAllAsync(cancellationToken))
Aspire.Dashboard.Tests (10)
ChannelExtensionsTests.cs (4)
91var read1 = await resultChannel.Reader.ReadAsync().DefaultTimeout(); 96var read2 = await resultChannel.Reader.ReadAsync().DefaultTimeout(); 135var read1 = await resultChannel.Reader.ReadAsync().DefaultTimeout(); 140var read2Task = resultChannel.Reader.ReadAsync().DefaultTimeout();
ResourceOutgoingPeerResolverTests.cs (4)
134Assert.False(resultChannel.Reader.TryRead(out readValue)); 142readValue = await resultChannel.Reader.ReadAsync().DefaultTimeout(); 149readValue = await resultChannel.Reader.ReadAsync().DefaultTimeout(); 156await foreach (var item in sourceChannel.Reader.ReadAllAsync(cancellationToken))
TelemetryRepositoryTests\LogTests.cs (2)
749var read1 = await resultChannel.Reader.ReadAsync().DefaultTimeout(); 770var read2 = await resultChannel.Reader.ReadAsync().DefaultTimeout();
Aspire.Hosting (5)
ApplicationModel\ResourceLoggerService.cs (2)
191await foreach (var item in channel.Reader.ReadAllAsync().ConfigureAwait(false)) 237await foreach (var entry in channel.Reader.ReadAllAsync(cancellationToken).ConfigureAwait(false))
ApplicationModel\ResourceNotificationService.cs (1)
322await foreach (var item in channel.Reader.ReadAllAsync(cancellationToken).ConfigureAwait(false))
src\Shared\ChannelExtensions.cs (2)
36if (await channel.Reader.WaitToReadAsync(cancellationToken).ConfigureAwait(false)) 48while (!cancellationToken.IsCancellationRequested && channel.Reader.TryRead(out var log))
Aspire.Hosting.Tests (11)
Dashboard\DashboardLifecycleHookTests.cs (1)
68var logContext = await logChannel.Reader.ReadAsync().DefaultTimeout();
Dcp\ApplicationExecutorTests.cs (1)
614await foreach (var item in logStreamPipesChannel.Reader.ReadAllAsync())
Dcp\TestKubernetesService.cs (1)
121var (evtType, res) = await chan.Reader.ReadAsync(cancellationToken);
Health\ResourceHealthCheckServiceTests.cs (3)
161var firstCheck = await channel.Reader.ReadAsync(abortTokenSource.Token).DefaultTimeout(); 164var secondCheck = await channel.Reader.ReadAsync(abortTokenSource.Token).DefaultTimeout(); 167var thirdCheck = await channel.Reader.ReadAsync(abortTokenSource.Token).DefaultTimeout();
Utils\Grpc\TestAsyncStreamReader.cs (2)
39if (await _channel.Reader.WaitToReadAsync(cancellationToken) && 40_channel.Reader.TryRead(out var message))
Utils\Grpc\TestServerStreamWriter.cs (3)
30return _channel.Reader.ReadAllAsync(); 35if (await _channel.Reader.WaitToReadAsync()) 37_channel.Reader.TryRead(out var message);
ClientSample (4)
UploadSample.cs (4)
45var invokeTask = connection.InvokeAsync<string>("UploadWord", channel.Reader); 65var result = await connection.InvokeAsync<string>("ScoreTracker", channel_one.Reader, channel_two.Reader); 95var outputs = await connection.StreamAsChannelAsync<string>("StreamEcho", channel.Reader);
InMemory.FunctionalTests (6)
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (4)
92internal ChannelReader<KeyValuePair<Http3SettingType, long>> ServerReceivedSettingsReader => _serverReceivedSettings.Reader; 111var reader = MultiplexedConnectionContext.ToClientAcceptQueue.Reader; 1055while (await ToServerAcceptQueue.Reader.WaitToReadAsync(cancellationToken)) 1057while (ToServerAcceptQueue.Reader.TryRead(out var connection))
TestTransport\InMemoryTransportFactory.cs (2)
26if (await _acceptQueue.Reader.WaitToReadAsync(cancellationToken)) 28while (_acceptQueue.Reader.TryRead(out var item))
Microsoft.AspNetCore.ConcurrencyLimiter.Tests (1)
src\Shared\EventSource.Testing\TestCounterListener.cs (1)
35return _counters[counterName].Reader.ReadAllAsync(cancellationToken);
Microsoft.AspNetCore.Hosting.Tests (1)
src\Shared\EventSource.Testing\TestCounterListener.cs (1)
35return _counters[counterName].Reader.ReadAllAsync(cancellationToken);
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 (3)
Internal\Http2\Http2FrameWriter.cs (2)
178while (await _channel.Reader.WaitToReadAsync()) 182while (_channel.Reader.TryRead(out var producer) && !producer.CompletedResponse)
Internal\WebTransport\WebTransportSession.cs (1)
175return await _pendingStreams.Reader.ReadAsync(cancellationToken);
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (4)
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (4)
92internal ChannelReader<KeyValuePair<Http3SettingType, long>> ServerReceivedSettingsReader => _serverReceivedSettings.Reader; 111var reader = MultiplexedConnectionContext.ToClientAcceptQueue.Reader; 1055while (await ToServerAcceptQueue.Reader.WaitToReadAsync(cancellationToken)) 1057while (ToServerAcceptQueue.Reader.TryRead(out var connection))
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (2)
Internal\NamedPipeConnectionListener.cs (2)
149while (await _acceptedQueue.Reader.WaitToReadAsync(cancellationToken)) 151if (_acceptedQueue.Reader.TryRead(out var connection))
Microsoft.AspNetCore.SignalR.Client.Core (6)
HubConnection.cs (1)
1604connectionState.InvocationMessageReceiveTask = StartProcessingInvocationMessages(invocationMessageChannel.Reader);
HubConnectionExtensions.StreamAsChannelAsync.cs (1)
282return outputChannel.Reader;
Internal\InvocationRequest.cs (1)
88public ChannelReader<object?> Result => _channel.Reader;
src\SignalR\common\Shared\MessageBuffer.cs (3)
138while (await _waitForAck.Reader.WaitToReadAsync(cancellationToken).ConfigureAwait(false)) 140if (_waitForAck.Reader.TryRead(out var count) && count < _bufferLimit) 149_waitForAck.Reader.TryRead(out _);
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (14)
HubConnectionTests.cs (3)
800var channel = await connection.StreamAsChannelAsync<string>("StreamEcho", channelWriter.Reader).DefaultTimeout(); 2957while (await _taskQueue.Reader.WaitToReadAsync()) 2960while (_taskQueue.Reader.TryRead(out var tuple))
HubConnectionTests.Tracing.cs (8)
83clientActivity1 = await clientChannel.Reader.ReadAsync().DefaultTimeout(); 105clientActivity2 = await clientChannel.Reader.ReadAsync().DefaultTimeout(); 138var serverActivities = await serverChannel.Reader.ReadAtLeastAsync(minimumCount: 4).DefaultTimeout(); 310var serverActivities = await serverChannel.Reader.ReadAtLeastAsync(minimumCount: 3).DefaultTimeout(); 439var serverActivities = await serverChannel.Reader.ReadAtLeastAsync(minimumCount: 3).DefaultTimeout(); 536var serverActivities = await serverChannel.Reader.ReadAtLeastAsync(minimumCount: 3).DefaultTimeout(); 631var serverActivities = await serverChannel.Reader.ReadAtLeastAsync(minimumCount: 3).DefaultTimeout(); 730var serverActivities = await serverChannel.Reader.ReadAtLeastAsync(minimumCount: 3).DefaultTimeout();
Hubs.cs (3)
240return channel.Reader; 271return output.Reader; 295return output.Reader;
Microsoft.AspNetCore.SignalR.Client.Tests (18)
HubConnectionTests.cs (8)
439var invokeTask = hubConnection.InvokeAsync<int>("SomeMethod", channel.Reader); 479var sendTask = hubConnection.SendAsync("SomeMethod", channel.Reader); 510var invokeTask = hubConnection.InvokeAsync<SampleObject>("UploadMethod", channel.Reader); 555var invokeTask = hubConnection.InvokeAsync<object>("UploadMethod", channel.Reader, cts.Token); 587var invokeTask = hubConnection.InvokeAsync<object>("UploadMethod", channel.Reader, cts.Token); 612var invokeTask = hubConnection.InvokeAsync<object>("UploadMethod", channel.Reader); 646var invokeTask = hubConnection.InvokeAsync<long>("UploadMethod", channel.Reader); 679var invokeTask = hubConnection.InvokeAsync<int>("SumInts", channel.Reader);
HubServerProxyGeneratorTests.cs (10)
176var asyncEnumerable = channelForEnumerable.Reader.ReadAllAsync(); 186.Returns(Task.FromResult(channel.Reader)); 193.Returns(Task.FromResult(channel.Reader)); 217var channelReader = channel.Reader; 219var asyncEnumerable = channelForEnumerable.Reader.ReadAllAsync(); 259var retChannelReader = retChannel.Reader; 261var argEnumerable = argChannelForEnumerable.Reader.ReadAllAsync(); 263var retEnumerable = retChannelForEnumerable.Reader.ReadAllAsync(); 297_ = await myHub.StreamBidirectionalViaChannel(argChannel.Reader); 298_ = await myHub.StreamBidirectionalViaChannelWithToken(argChannel.Reader, token);
Microsoft.AspNetCore.SignalR.Core (7)
Internal\ChannelBasedSemaphore.cs (2)
26return _channel.Reader.TryRead(out _); 32return _channel.Reader.ReadAsync(cancellationToken);
src\SignalR\common\Shared\MessageBuffer.cs (3)
138while (await _waitForAck.Reader.WaitToReadAsync(cancellationToken).ConfigureAwait(false)) 140if (_waitForAck.Reader.TryRead(out var count) && count < _bufferLimit) 149_waitForAck.Reader.TryRead(out _);
StreamTracker.cs (2)
124return _channel.Reader.ReadAllAsync(); 128return _channel.Reader;
Microsoft.AspNetCore.SignalR.Microbenchmarks (1)
DefaultHubDispatcherBenchmark.cs (1)
171return channel.Reader;
Microsoft.AspNetCore.SignalR.Tests (39)
HubConnectionHandlerTests.Activity.cs (20)
54var connectActivity = await serverChannel.Reader.ReadAsync().DefaultTimeout(); 63var invocation1Activity = await serverChannel.Reader.ReadAsync().DefaultTimeout(); 69var invocation2Activity = await serverChannel.Reader.ReadAsync().DefaultTimeout(); 75var invocation3Activity = await serverChannel.Reader.ReadAsync().DefaultTimeout(); 78var userCodeActivity = await serverChannel.Reader.ReadAsync().DefaultTimeout(); 87var disconnectActivity = await serverChannel.Reader.ReadAsync().DefaultTimeout(); 129var connectActivity = await serverChannel.Reader.ReadAsync().DefaultTimeout(); 145var invocationActivity = await serverChannel.Reader.ReadAsync().DefaultTimeout(); 159var disconnectActivity = await serverChannel.Reader.ReadAsync().DefaultTimeout(); 200var connectActivity = await serverChannel.Reader.ReadAsync().DefaultTimeout(); 205var invocation1Activity = await serverChannel.Reader.ReadAsync().DefaultTimeout(); 210var invocation2Activity = await serverChannel.Reader.ReadAsync().DefaultTimeout(); 218var disconnectedActivity = await serverChannel.Reader.ReadAsync().DefaultTimeout(); 259var connectActivity = await serverChannel.Reader.ReadAsync().DefaultTimeout(); 271var invocationActivity = await serverChannel.Reader.ReadAsync().DefaultTimeout(); 285var disconnectActivity = await serverChannel.Reader.ReadAsync().DefaultTimeout(); 330var activity = await serverChannel.Reader.ReadAsync().DefaultTimeout(); 381var activities = await serverChannel.Reader.ReadAtLeastAsync(minimumCount: 2); 431var activities = await serverChannel.Reader.ReadAtLeastAsync(minimumCount: 2); 482var activities = await serverChannel.Reader.ReadAtLeastAsync(minimumCount: 2);
HubConnectionHandlerTests.cs (1)
4734provider.AddSingleton(channel.Reader);
HubConnectionHandlerTestUtils\Hubs.cs (14)
296return channel.Reader; 715return channel.Reader; 773return Channel.CreateUnbounded<string>().Reader; 780return channel.Reader; 787return channel.Reader; 794return channel.Reader; 829return output.Reader; 1030return Channel.CreateUnbounded<string>().Reader; 1045return channel.Reader; 1060return channel.Reader; 1075return channel.Reader; 1090return channel.Reader; 1105return channel.Reader; 1146return channel.Reader;
NativeAotTests.cs (4)
80var echoResponseReader = await connection.StreamAsChannelAsync<string>(nameof(AsyncMethodHub.StreamEcho), channel.Reader); 118stringResult = await connection.InvokeAsync<string>(nameof(AsyncMethodHub.ChannelShortParameter), channelShorts.Reader); 261return output.Reader; 295return output.Reader;
Microsoft.CodeAnalysis.CodeStyle (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IAsyncEnumerableExtensions.cs (1)
72return channel.Reader.ReadAllAsync(cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\ProducerConsumer.cs (1)
308return await consumeItems(channel.Reader, args, cancellationToken).ConfigureAwait(false);
Microsoft.CodeAnalysis.Workspaces (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IAsyncEnumerableExtensions.cs (1)
72return channel.Reader.ReadAllAsync(cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\ProducerConsumer.cs (1)
308return await consumeItems(channel.Reader, args, cancellationToken).ConfigureAwait(false);
Microsoft.Extensions.AI (1)
ChatCompletion\AnonymousDelegatingChatClient.cs (1)
158return updates.Reader.ReadAllAsync(cancellationToken);
Microsoft.Extensions.ServiceDiscovery.Tests (1)
ServiceEndpointResolverTests.cs (1)
273var next = await channel.Reader.ReadAsync(CancellationToken.None);
Microsoft.ML.Data (3)
Transforms\RowShufflingTransformer.cs (3)
571while (await _toProduceChannel.Reader.WaitToReadAsync().ConfigureAwait(false)) 574if (!_toProduceChannel.Reader.TryRead(out requested)) 637ValueTask<int> readTask = _toConsumeChannel.Reader.ReadAsync();
Microsoft.ML.Sweeper (1)
AsyncSweeper.cs (1)
282return await _paramChannel.Reader.ReadAsync(_cts.Token);
SignalR.Client.FunctionalTestApp (3)
TestHub.cs (3)
67return channel.Reader; 80return channel.Reader; 102return channel.Reader;
SignalRSamples (4)
Hubs\Streaming.cs (1)
45return channel.Reader;
Hubs\UploadHub.cs (1)
81return output.Reader;
ObservableExtensions.cs (2)
35channel.Reader.Completion.ContinueWith(task => 41return channel.Reader;
Stress.ApiService (2)
ProducerConsumer.cs (1)
30await foreach (var item in _channel.Reader.ReadAllAsync())
Program.cs (1)
170await foreach (var message in channel.Reader.ReadAllAsync(cancellationToken))
System.Net.Http (2)
System\Net\Http\SocketsHttpHandler\Http2Connection.cs (2)
1197while (await _writeChannel.Reader.WaitToReadAsync().ConfigureAwait(false)) 1199while (_writeChannel.Reader.TryRead(out WriteQueueEntry? writeEntry))
System.Net.Quic (4)
System\Net\Quic\QuicConnection.cs (2)
577return await _acceptQueue.Reader.ReadAsync(cancellationToken).ConfigureAwait(false); 864while (_acceptQueue.Reader.TryRead(out QuicStream? stream))
System\Net\Quic\QuicListener.cs (2)
183object item = await _acceptQueue.Reader.ReadAsync(cancellationToken).ConfigureAwait(false); 434while (_acceptQueue.Reader.TryRead(out object? item))
System.Threading.Channels (1)
System\Threading\Channels\Channel_2.cs (1)
22public static implicit operator ChannelReader<TRead>(Channel<TWrite, TRead> channel) => channel.Reader;
TestDiscoveryWorker (2)
Program.cs (2)
120while (await _channel.Reader.WaitToReadAsync(CancellationToken.None).ConfigureAwait(false)) 122while (_channel.Reader.TryRead(out var item))