4 types derived from Channel
System.Threading.Channels (4)
System\Threading\Channels\BoundedChannel.cs (1)
14internal sealed class BoundedChannel<T> : Channel<T>, IDebugEnumerable<T>
System\Threading\Channels\SingleConsumerUnboundedChannel.cs (1)
18internal sealed class SingleConsumerUnboundedChannel<T> : Channel<T>, IDebugEnumerable<T>
System\Threading\Channels\UnboundedChannel.cs (1)
15internal sealed class UnboundedChannel<T> : Channel<T>, IDebugEnumerable<T>
System\Threading\Channels\UnboundedPriorityChannel.cs (1)
19internal sealed class UnboundedPrioritizedChannel<T> : Channel<T>, IDebugEnumerable<T>
165 references to Channel
Aspire.Components.Common.Tests (1)
ActivityNotifier.cs (1)
16private readonly Channel<Activity> _activityChannel = Channel.CreateUnbounded<Activity>();
Aspire.Confluent.Kafka (1)
MetricsChannel.cs (1)
17private readonly Channel<string> _channel = Channel.CreateBounded<string>(new BoundedChannelOptions(10_000)
Aspire.Dashboard (4)
ResourceService\DashboardClient.cs (3)
55private ImmutableHashSet<Channel<IReadOnlyList<ResourceViewModelChange>>> _outgoingChannels = []; 435var channel = Channel.CreateUnbounded<IReadOnlyList<ResourceViewModelChange>>( 484var channel = Channel.CreateUnbounded<IReadOnlyList<ResourceLogLine>>(
src\Shared\ChannelExtensions.cs (1)
26this Channel<T> channel,
Aspire.Dashboard.Components.Tests (11)
Pages\ConsoleLogsTests.cs (4)
37var consoleLogsChannel = Channel.CreateUnbounded<IReadOnlyList<ResourceLogLine>>(); 38var resourceChannel = Channel.CreateUnbounded<IReadOnlyList<ResourceViewModelChange>>(); 96var consoleLogsChannel = Channel.CreateUnbounded<IReadOnlyList<ResourceLogLine>>(); 97var resourceChannel = Channel.CreateUnbounded<IReadOnlyList<ResourceViewModelChange>>();
Shared\TestDashboardClient.cs (7)
13private readonly Func<string, Channel<IReadOnlyList<ResourceLogLine>>>? _consoleLogsChannelProvider; 14private readonly Func<Channel<IReadOnlyList<ResourceViewModelChange>>>? _resourceChannelProvider; 23Func<string, Channel<IReadOnlyList<ResourceLogLine>>>? consoleLogsChannelProvider = null, 24Func<Channel<IReadOnlyList<ResourceViewModelChange>>>? resourceChannelProvider = null, 50var channel = _consoleLogsChannelProvider(resourceName); 65var channel = _resourceChannelProvider(); 69async static IAsyncEnumerable<IReadOnlyList<ResourceViewModelChange>> BuildSubscription(Channel<IReadOnlyList<ResourceViewModelChange>> channel, [EnumeratorCancellation] CancellationToken cancellationToken)
Aspire.Dashboard.Tests (10)
ChannelExtensionsTests.cs (6)
18var channel = Channel.CreateUnbounded<IReadOnlyList<string>>(); 42var channel = Channel.CreateUnbounded<IReadOnlyList<string>>(); 66var channel = Channel.CreateUnbounded<IReadOnlyList<string>>(); 67var resultChannel = Channel.CreateUnbounded<IReadOnlyList<IReadOnlyList<string>>>(); 110var channel = Channel.CreateUnbounded<IReadOnlyList<string>>(); 111var resultChannel = Channel.CreateUnbounded<IReadOnlyList<IReadOnlyList<string>>>();
Integration\DashboardClientAuthTests.cs (1)
159public Channel<ReceivedCallInfo<ApplicationInformationRequest>> ApplicationInformationCallsChannel { get; } = Channel.CreateUnbounded<ReceivedCallInfo<ApplicationInformationRequest>>();
ResourceOutgoingPeerResolverTests.cs (2)
122var sourceChannel = Channel.CreateUnbounded<ResourceViewModelChange>(); 123var resultChannel = Channel.CreateUnbounded<int>();
TelemetryRepositoryTests\LogTests.cs (1)
671var resultChannel = Channel.CreateUnbounded<int>();
Aspire.Hosting (10)
ApplicationModel\ResourceLoggerService.cs (2)
110var channel = Channel.CreateUnbounded<LogSubscriber>(); 249var channel = Channel.CreateUnbounded<LogEntry>();
ApplicationModel\ResourceNotificationService.cs (1)
310var channel = Channel.CreateUnbounded<ResourceEvent>();
Dashboard\ResourcePublisher.cs (4)
23private ImmutableHashSet<Channel<ResourceSnapshotChange>> _outgoingChannels = []; 49var channel = Channel.CreateUnbounded<ResourceSnapshotChange>( 86ImmutableHashSet<Channel<ResourceSnapshotChange>> channels; 104foreach (var channel in channels)
Dcp\ApplicationExecutor.cs (1)
117private readonly Channel<LogInformationEntry> _logInformationChannel = Channel.CreateUnbounded<LogInformationEntry>(
Dcp\ResourceLogSource.cs (1)
28var channel = Channel.CreateUnbounded<LogEntry>(new UnboundedChannelOptions
src\Shared\ChannelExtensions.cs (1)
26this Channel<T> channel,
Aspire.Hosting.Tests (7)
Dashboard\DashboardLifecycleHookTests.cs (1)
34var logChannel = Channel.CreateUnbounded<WriteContext>();
Dcp\ApplicationExecutorTests.cs (2)
388var logStreamPipesChannel = Channel.CreateUnbounded<(string Type, Pipe Pipe)>(); 553private static async Task<LogStreamPipes> GetStreamPipesAsync(Channel<(string Type, Pipe Pipe)> logStreamPipesChannel)
Dcp\TestKubernetesService.cs (4)
24private readonly List<Channel<(WatchEventType, CustomResource)>> _watchChannels = []; 71foreach (var c in _watchChannels) 84foreach (var c in _watchChannels) 106var chan = Channel.CreateUnbounded<(WatchEventType, CustomResource)>();
ClientSample (4)
UploadSample.cs (4)
44var channel = Channel.CreateUnbounded<string>(); 60var channel_one = Channel.CreateBounded<int>(2); 61var channel_two = Channel.CreateBounded<int>(2); 85var channel = Channel.CreateUnbounded<string>();
InMemory.FunctionalTests (4)
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (3)
83internal readonly Channel<KeyValuePair<Http3SettingType, long>> _serverReceivedSettings; 991public readonly Channel<ConnectionContext> ToServerAcceptQueue = Channel.CreateUnbounded<ConnectionContext>(new UnboundedChannelOptions 997public readonly Channel<Http3ControlStream> ToClientAcceptQueue = Channel.CreateUnbounded<Http3ControlStream>(new UnboundedChannelOptions
TestTransport\InMemoryTransportFactory.cs (1)
15private readonly Channel<ConnectionContext> _acceptQueue = Channel.CreateUnbounded<ConnectionContext>();
Microsoft.AspNetCore.ConcurrencyLimiter.Tests (2)
src\Shared\EventSource.Testing\TestCounterListener.cs (2)
14private readonly Dictionary<string, Channel<double>> _counters = new Dictionary<string, Channel<double>>();
Microsoft.AspNetCore.Hosting.Tests (2)
src\Shared\EventSource.Testing\TestCounterListener.cs (2)
14private readonly Dictionary<string, Channel<double>> _counters = new Dictionary<string, Channel<double>>();
Microsoft.AspNetCore.Http.Connections.Tests (2)
TestWebSocketConnectionFeature.cs (2)
40var clientToServer = Channel.CreateUnbounded<WebSocketMessage>(); 41var serverToClient = Channel.CreateUnbounded<WebSocketMessage>();
Microsoft.AspNetCore.Server.Kestrel.Core (3)
Internal\Http2\Http2FrameWriter.cs (2)
23/// Since a connection has multiple streams, this class maintains a <see cref="Channel{T}"/> (i.e. bounded queue) 86private readonly Channel<Http2OutputProducer> _channel;
Internal\WebTransport\WebTransportSession.cs (1)
26private readonly Channel<WebTransportStream> _pendingStreams;
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (3)
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (3)
83internal readonly Channel<KeyValuePair<Http3SettingType, long>> _serverReceivedSettings; 991public readonly Channel<ConnectionContext> ToServerAcceptQueue = Channel.CreateUnbounded<ConnectionContext>(new UnboundedChannelOptions 997public readonly Channel<Http3ControlStream> ToClientAcceptQueue = Channel.CreateUnbounded<Http3ControlStream>(new UnboundedChannelOptions
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (1)
Internal\NamedPipeConnectionListener.cs (1)
26private readonly Channel<ConnectionContext> _acceptedQueue;
Microsoft.AspNetCore.SignalR.Client.Core (5)
HubConnection.cs (1)
1601var invocationMessageChannel = Channel.CreateUnbounded<InvocationMessage>(_receiveLoopOptions);
HubConnectionExtensions.StreamAsChannelAsync.cs (2)
277var outputChannel = Channel.CreateUnbounded<TResult>(); 287private static async Task RunChannel<TResult>(ChannelReader<object?> inputChannel, Channel<TResult> outputChannel)
Internal\InvocationRequest.cs (1)
81private readonly Channel<object?> _channel = Channel.CreateUnbounded<object?>();
src\SignalR\common\Shared\MessageBuffer.cs (1)
32private readonly Channel<long> _waitForAck = Channel.CreateBounded<long>(new BoundedChannelOptions(1) { FullMode = BoundedChannelFullMode.DropOldest });
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (12)
HubConnectionTests.cs (2)
799var channelWriter = Channel.CreateBounded<string>(5); 2925private readonly Channel<(SendOrPostCallback, object)> _taskQueue = Channel.CreateUnbounded<(SendOrPostCallback, object)>();
HubConnectionTests.Tracing.cs (7)
35var serverChannel = Channel.CreateUnbounded<Activity>(); 36var clientChannel = Channel.CreateUnbounded<Activity>(); 229var serverChannel = Channel.CreateUnbounded<Activity>(); 374var serverChannel = Channel.CreateUnbounded<Activity>(); 477var serverChannel = Channel.CreateUnbounded<Activity>(); 573var serverChannel = Channel.CreateUnbounded<Activity>(); 663var serverChannel = Channel.CreateUnbounded<Activity>();
Hubs.cs (3)
227var channel = Channel.CreateUnbounded<int>(); 252var output = Channel.CreateUnbounded<string>(); 276var output = Channel.CreateUnbounded<int>();
Microsoft.AspNetCore.SignalR.Client.Tests (16)
HubConnectionTests.cs (8)
438var channel = Channel.CreateUnbounded<int>(); 478var channel = Channel.CreateUnbounded<int>(); 509var channel = Channel.CreateUnbounded<object>(); 554var channel = Channel.CreateUnbounded<int>(); 586var channel = Channel.CreateUnbounded<int>(); 611var channel = Channel.CreateUnbounded<int>(); 645var channel = Channel.CreateUnbounded<int>(); 678var channel = Channel.CreateUnbounded<int>();
HubServerProxyGeneratorTests.cs (8)
174var channel = Channel.CreateUnbounded<object>(); 175var channelForEnumerable = Channel.CreateUnbounded<int>(); 216var channel = Channel.CreateUnbounded<int>(); 218var channelForEnumerable = Channel.CreateUnbounded<int>(); 257var argChannel = Channel.CreateUnbounded<float>(); 258var retChannel = Channel.CreateUnbounded<object>(); 260var argChannelForEnumerable = Channel.CreateUnbounded<float>(); 262var retChannelForEnumerable = Channel.CreateUnbounded<int>();
Microsoft.AspNetCore.SignalR.Core (3)
Internal\ChannelBasedSemaphore.cs (1)
13private readonly Channel<int> _channel;
src\SignalR\common\Shared\MessageBuffer.cs (1)
32private readonly Channel<long> _waitForAck = Channel.CreateBounded<long>(new BoundedChannelOptions(1) { FullMode = BoundedChannelFullMode.DropOldest });
StreamTracker.cs (1)
108private readonly Channel<T?> _channel;
Microsoft.AspNetCore.SignalR.Microbenchmarks (4)
DefaultHubDispatcherBenchmark.cs (4)
136var channel = Channel.CreateUnbounded<int>(); 144var channel = Channel.CreateUnbounded<int>(); 152var channel = Channel.CreateUnbounded<int>(); 160var channel = Channel.CreateUnbounded<int>();
Microsoft.AspNetCore.SignalR.Tests (25)
HubConnectionHandlerTests.Activity.cs (8)
22var serverChannel = Channel.CreateUnbounded<Activity>(); 97var serverChannel = Channel.CreateUnbounded<Activity>(); 169var serverChannel = Channel.CreateUnbounded<Activity>(); 228var serverChannel = Channel.CreateUnbounded<Activity>(); 301var serverChannel = Channel.CreateUnbounded<Activity>(); 348var serverChannel = Channel.CreateUnbounded<Activity>(); 400var serverChannel = Channel.CreateUnbounded<Activity>(); 451var serverChannel = Channel.CreateUnbounded<Activity>();
HubConnectionHandlerTests.cs (1)
4731var channel = Channel.CreateBounded<int>(10);
HubConnectionHandlerTestUtils\Hubs.cs (12)
293var channel = Channel.CreateUnbounded<string>(); 704var channel = Channel.CreateUnbounded<string>(); 778var channel = Channel.CreateUnbounded<int>(); 785var channel = Channel.CreateUnbounded<int>(); 792var channel = Channel.CreateUnbounded<int>(); 814Channel<string> output = Channel.CreateUnbounded<string>(); 1035var channel = Channel.CreateBounded<int>(10); 1050var channel = Channel.CreateBounded<int>(10); 1065var channel = Channel.CreateBounded<int>(10); 1080var channel = Channel.CreateBounded<int>(10); 1095var channel = Channel.CreateBounded<int>(10); 1131var channel = Channel.CreateBounded<int>(10);
NativeAotTests.cs (4)
79var channel = Channel.CreateBounded<string>(10); 112var channelShorts = Channel.CreateBounded<short>(10); 249Channel<string> output = Channel.CreateUnbounded<string>(); 282Channel<char> output = Channel.CreateUnbounded<char>();
Microsoft.CodeAnalysis.CodeStyle (5)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IAsyncEnumerableExtensions.cs (3)
59var channel = Channel.CreateBounded<T>(1024); 95public static void CompletesChannel<T>(this Task task, Channel<T> channel) 100static (task, channel) => ((Channel<T>)channel!).Writer.Complete(task.Exception),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\ProducerConsumer.cs (2)
264/// cref="Channel{T}"/>, which will then then manage the rules and behaviors around the routines. Importantly, the 283var channel = Channel.CreateUnbounded<TItem>(new()
Microsoft.CodeAnalysis.Workspaces (6)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IAsyncEnumerableExtensions.cs (3)
59var channel = Channel.CreateBounded<T>(1024); 95public static void CompletesChannel<T>(this Task task, Channel<T> channel) 100static (task, channel) => ((Channel<T>)channel!).Writer.Complete(task.Exception),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\ProducerConsumer.cs (3)
264/// cref="Channel{T}"/>, which will then then manage the rules and behaviors around the routines. Importantly, the 283var channel = Channel.CreateUnbounded<TItem>(new() 293static (obj, cancellationToken) => ((Channel<TItem>)obj!).Writer.TryComplete(new OperationCanceledException(cancellationToken)),
Microsoft.Extensions.ServiceDiscovery.Tests (1)
ServiceEndpointResolverTests.cs (1)
264var channel = Channel.CreateUnbounded<ServiceEndpointResolverResult>();
Microsoft.ML.Data (3)
Transforms\RowShufflingTransformer.cs (3)
490private readonly Channel<int> _toProduceChannel; 491private readonly Channel<int> _toConsumeChannel; 555public static void PostAssert<T>(Channel<T> target, T item)
Microsoft.ML.Sweeper (1)
AsyncSweeper.cs (1)
171private readonly Channel<ParameterSetWithId> _paramChannel;
SignalR.Client.FunctionalTestApp (3)
TestHub.cs (3)
62var channel = Channel.CreateUnbounded<string>(); 72var channel = Channel.CreateUnbounded<string>(); 100var channel = Channel.CreateUnbounded<int>();
SignalRSamples (3)
Hubs\Streaming.cs (1)
32var channel = Channel.CreateUnbounded<int>();
Hubs\UploadHub.cs (1)
65var output = Channel.CreateUnbounded<string>();
ObservableExtensions.cs (1)
26var channel = maxBufferSize != null ? Channel.CreateBounded<T>(maxBufferSize.Value) : Channel.CreateUnbounded<T>();
Stress.ApiService (2)
ProducerConsumer.cs (1)
20private readonly Channel<Data> _channel = Channel.CreateUnbounded<Data>();
Program.cs (1)
125var channel = Channel.CreateUnbounded<string>();
System.Net.Http (1)
System\Net\Http\SocketsHttpHandler\Http2Connection.cs (1)
55private readonly Channel<WriteQueueEntry> _writeChannel;
System.Net.Quic (2)
System\Net\Quic\QuicConnection.cs (1)
149private readonly Channel<QuicStream> _acceptQueue = Channel.CreateUnbounded<QuicStream>(new UnboundedChannelOptions()
System\Net\Quic\QuicListener.cs (1)
99private readonly Channel<object> _acceptQueue;
System.Threading.Channels (7)
System\Threading\Channels\Channel.cs (5)
11public static Channel<T> CreateUnbounded<T>() => 18public static Channel<T> CreateUnbounded<T>(UnboundedChannelOptions options) 41public static Channel<T> CreateBounded<T>(int capacity) 55public static Channel<T> CreateBounded<T>(BoundedChannelOptions options) 65public static Channel<T> CreateBounded<T>(BoundedChannelOptions options, Action<T>? itemDropped)
System\Threading\Channels\Channel.netcoreapp.cs (2)
17public static Channel<T> CreateUnboundedPrioritized<T>() => 29public static Channel<T> CreateUnboundedPrioritized<T>(UnboundedPrioritizedChannelOptions<T> options)
TestDiscoveryWorker (1)
Program.cs (1)
116private readonly Channel<string> _channel;