5 writes to Writer
System.Threading.Channels (5)
System\Threading\Channels\BoundedChannel.cs (1)
65Writer = new BoundedChannelWriter(this);
System\Threading\Channels\RendezvousChannel.cs (1)
56Writer = new RendezvousChannelWriter(this);
System\Threading\Channels\SingleConsumerUnboundedChannel.cs (1)
48Writer = new UnboundedChannelWriter(this);
System\Threading\Channels\UnboundedChannel.cs (1)
42Writer = new UnboundedChannelWriter(this);
System\Threading\Channels\UnboundedPriorityChannel.cs (1)
49Writer = new UnboundedPrioritizedChannelWriter(this);
378 references to Writer
aspire (46)
Backchannel\AuxiliaryBackchannelMonitor.cs (3)
72void QueueConnectionChange() => connectionChanges.Writer.TryWrite(true); 105connectionChanges.Writer.TryComplete(); 117connectionChanges.Writer.TryComplete();
Backchannel\ResourceSnapshotWatcher.cs (4)
136_updateSignal?.Writer.TryComplete(); 141_updateSignal?.Writer.TryComplete(); 146_updateSignal?.Writer.TryComplete(ex); 200_updateSignal?.Writer.TryWrite(true);
Commands\PsCommand.cs (2)
200await updates.Writer.WriteAsync(new ConnectionsUpdate(connections), followCancellationToken).ConfigureAwait(false); 213updates.Writer.TryComplete();
Diagnostics\FileLoggerProvider.cs (4)
144if (_channel.Writer.TryWrite(message)) 160if (!_channel.Writer.WaitToWriteAsync().AsTask().GetAwaiter().GetResult()) 166_channel.Writer.TryWrite(message); 204_channel?.Writer.TryComplete();
Interaction\ExtensionInteractionService.cs (32)
72await _extensionTaskChannel.Writer.WriteAsync(() => 83var result = _extensionTaskChannel.Writer.TryWrite(() => Backchannel.ShowStatusAsync(StringUtils.RemoveMarkup(statusText), _cancellationToken)); 93result = _extensionTaskChannel.Writer.TryWrite(() => Backchannel.ShowStatusAsync(null, _cancellationToken)); 100var result = _extensionTaskChannel.Writer.TryWrite(() => Backchannel.ShowStatusAsync(StringUtils.RemoveMarkup(initialStatusText), _cancellationToken)); 109var result = _extensionTaskChannel.Writer.TryWrite(() => Backchannel.ShowStatusAsync(StringUtils.RemoveMarkup(statusText), _cancellationToken)); 117result = _extensionTaskChannel.Writer.TryWrite(() => Backchannel.ShowStatusAsync(null, _cancellationToken)); 124var result = _extensionTaskChannel.Writer.TryWrite(() => Backchannel.ShowStatusAsync(StringUtils.RemoveMarkup(statusText), _cancellationToken)); 134result = _extensionTaskChannel.Writer.TryWrite(() => Backchannel.ShowStatusAsync(null, _cancellationToken)); 154await _extensionTaskChannel.Writer.WriteAsync(async () => 215await _extensionTaskChannel.Writer.WriteAsync(async () => 277await _extensionTaskChannel.Writer.WriteAsync(async () => 315await _extensionTaskChannel.Writer.WriteAsync(async () => 354await _extensionTaskChannel.Writer.WriteAsync(async () => 383var result = _extensionTaskChannel.Writer.TryWrite(() => Backchannel.DisplayIncompatibleVersionErrorAsync(ex.RequiredCapability, appHostHostingSdkVersion, _cancellationToken)); 396var result = _extensionTaskChannel.Writer.TryWrite(async () => 406var result = _extensionTaskChannel.Writer.TryWrite(async () => 416var result = _extensionTaskChannel.Writer.TryWrite(() => Backchannel.DisplaySuccessAsync(StringUtils.RemoveMarkup(message), _cancellationToken)); 423var result = _extensionTaskChannel.Writer.TryWrite(() => Backchannel.DisplaySubtleMessageAsync(StringUtils.RemoveMarkup(message), _cancellationToken)); 435var result = _extensionTaskChannel.Writer.TryWrite(() => Backchannel.DisplayDashboardUrlsAsync(dashboardUrls, _cancellationToken)); 444var result = _extensionTaskChannel.Writer.TryWrite(() => Backchannel.DisplayLinesAsync(materialized.Select(line => new DisplayLineState( 459var result = _extensionTaskChannel.Writer.TryWrite(() => Backchannel.DisplayCancellationMessageAsync(_cancellationToken)); 466var result = _extensionTaskChannel.Writer.TryWrite(() => Backchannel.DisplayEmptyLineAsync(_cancellationToken)); 473var result = _extensionTaskChannel.Writer.TryWrite(() => Backchannel.OpenEditorAsync(path, _cancellationToken)); 479var result = _extensionTaskChannel.Writer.TryWrite(() => Backchannel.DisplayPlainTextAsync(text, _cancellationToken)); 496var result = _extensionTaskChannel.Writer.TryWrite(() => Backchannel.DisplayPlainTextAsync(text, _cancellationToken)); 505var result = _extensionTaskChannel.Writer.TryWrite(() => Backchannel.LogMessageAsync(LogLevel.Information, markdown, _cancellationToken)); 513var result = _extensionTaskChannel.Writer.TryWrite(() => Backchannel.LogMessageAsync(LogLevel.Information, StringUtils.RemoveMarkup(markup), _cancellationToken)); 535var result = _extensionTaskChannel.Writer.TryWrite(() => Backchannel.LogMessageAsync(logLevel, StringUtils.RemoveMarkup(message), _cancellationToken)); 551var result = _extensionTaskChannel.Writer.TryWrite(() => Backchannel.NotifyAppHostStartupCompletedAsync(_cancellationToken)); 567var result = _extensionTaskChannel.Writer.TryWrite(() => Backchannel.WriteDebugSessionMessageAsync(StringUtils.RemoveMarkup(message), stdout, textStyle, _cancellationToken)); 573var result = _extensionTaskChannel.Writer.TryWrite(async () => await Backchannel.WriteAppHostLogEntryAsync(entry, _cancellationToken).ConfigureAwait(false)); 617_extensionTaskChannel.Writer.TryComplete();
Projects\ProjectLocator.cs (1)
200var discoveryTask = CompleteFindAppHostProjectsStreamAsync(searchDirectory, scope, channel.Writer, onDirectoryEnumerated, discoveryCancellationTokenSource.Token);
Aspire.Cli.Tests (8)
Backchannel\ResourceSnapshotWatcherTests.cs (3)
480await source.Writer.WriteAsync(firstSnapshot); 493await source.Writer.WriteAsync(new ResourceSnapshot 507source.Writer.TryComplete();
Commands\AgentMcpCommandTests.cs (2)
362notificationChannel.Writer.TryWrite(notification); 450notificationChannel.Writer.TryWrite(notification);
Commands\LogsCommandTests.cs (2)
1440logLines.Writer.TryWrite(line); 1481logLines.Writer.Complete();
TestServices\TestAuxiliaryBackchannelMonitor.cs (1)
55_connectionChanges.Writer.TryWrite(true);
Aspire.Components.Common.TestUtilities (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 (22)
Api\TelemetryApiService.cs (1)
531signal.Writer.TryWrite(true);
Components\Pages\ConsoleLogs.razor.cs (3)
1103_logEntryChannel.Writer.TryWrite(new LogEntryToWrite(subscription.Resource.Name, LogEntry.CreatePause(GetResourceName(subscription.Resource), priorPause.Start, priorPause.End), LineNumber: null)); 1123_logEntryChannel.Writer.TryWrite(new LogEntryToWrite(subscription.Resource.Name, logEntry, lineNumber)); 1276_logEntryChannel.Writer.TryWrite(new LogEntryToWrite(subscription.Resource.Name, LogEntry.CreatePause(GetResourceName(subscription.Resource), timestamp), LineNumber: null));
Otlp\Storage\SqliteTelemetryRepository.Runtime.cs (6)
271channel.Writer.TryComplete(); 331channel.Writer.TryComplete(); 366watcher.Channel.Writer.TryWrite(span); 401watcher.Channel.Writer.TryWrite(log); 413watcher.Channel.Writer.TryComplete(); 417watcher.Channel.Writer.TryComplete();
ServiceClient\DashboardClient.cs (5)
684channel.Writer.TryWrite(changes); 761channel.Writer.TryWrite(response); 797await _incomingInteractionChannel.Writer.WriteAsync(request, cancellationToken).ConfigureAwait(false); 963channel.Writer.TryWrite(CreateLogLines(response.LogLines)); 968channel.Writer.TryComplete();
ServiceClient\SqliteResourceRepository.cs (4)
383channel.Writer.TryWrite(viewModelLines); 505channel.Writer.TryWrite(changes); 535channel.Writer.TryComplete(); 539channel.Writer.TryComplete();
Telemetry\DashboardTelemetrySender.cs (3)
106_channel.Writer.TryComplete(); 169_channel.Writer.TryWrite((context, requestFunc)); 174_channel.Writer.TryComplete();
Aspire.Dashboard.Components.Tests (41)
Interactions\InteractionsProviderTests.cs (13)
154await interactionsChannel.Writer.WriteAsync(new WatchInteractionsResponseUpdate 201await interactionsChannel.Writer.WriteAsync(new WatchInteractionsResponseUpdate 220await interactionsChannel.Writer.WriteAsync(new WatchInteractionsResponseUpdate 260await interactionsChannel.Writer.WriteAsync(new WatchInteractionsResponseUpdate 326await interactionsChannel.Writer.WriteAsync(response); 386await interactionsChannel.Writer.WriteAsync(response); 406await interactionsChannel.Writer.WriteAsync(response); 459await interactionsChannel.Writer.WriteAsync(response); 479await interactionsChannel.Writer.WriteAsync(response); 543await interactionsChannel.Writer.WriteAsync(response); 592await interactionsChannel.Writer.WriteAsync(new WatchInteractionsResponseUpdate 646await interactionsChannel.Writer.WriteAsync(new WatchInteractionsResponseUpdate 665await interactionsChannel.Writer.WriteAsync(new WatchInteractionsResponseUpdate
Pages\ConsoleLogsTerminalTests.cs (2)
286resourceChannel.Writer.TryWrite([ 506consoleLogsChannel.Writer.TryWrite([
Pages\ConsoleLogsTests.cs (21)
50subscribedResourceNamesChannel.Writer.TryWrite(name); 101subscribedResourceNamesChannel.Writer.TryWrite(name); 133consoleLogsChannel.Writer.TryWrite([new ResourceLogLine(1, "Test content", IsErrorMessage: false)]); 134consoleLogsChannel.Writer.Complete(); 168subscribedResourceNamesChannel.Writer.Complete(); 373consoleLogsChannel.Writer.TryWrite([new ResourceLogLine(1, "Hello world", IsErrorMessage: false)]); 413liveConsoleLogsChannel.Writer.TryWrite([new ResourceLogLine(1, "Live log", IsErrorMessage: false)]); 460consoleLogsChannel.Writer.TryWrite([ 550consoleLogsChannel.Writer.Complete(new InvalidOperationException("Error!")); 601consoleLogsChannel.Writer.Complete(new InvalidOperationException("Error!")); 643consoleLogsChannel.Writer.TryWrite([new ResourceLogLine(1, "2025-02-08T10:16:08Z Hello world", IsErrorMessage: false)]); 668consoleLogsChannel.Writer.TryWrite([new ResourceLogLine(2, "2025-03-08T10:16:08Z Hello world", IsErrorMessage: false)]); 749consoleLogsChannel.Writer.TryWrite([new ResourceLogLine(1, "2025-02-08T10:16:08Z Hello world", IsErrorMessage: false)]); 761consoleLogsChannel.Writer.TryWrite([new ResourceLogLine(2, "2025-03-08T10:16:08Z Hello world", IsErrorMessage: false)]); 788consoleLogsChannel.Writer.TryWrite([ 852resourceChannel.Writer.TryWrite([ 966resourceCommandChannel.Writer.TryWrite(new ResourceCommandResponseViewModel 1037consoleLogsChannel.Writer.TryWrite([new ResourceLogLine(1, pauseContent, IsErrorMessage: false)]); 1038consoleLogsChannel.Writer.TryWrite([new ResourceLogLine(2, pauseContent, IsErrorMessage: false)]); 1039consoleLogsChannel.Writer.TryWrite([new ResourceLogLine(3, pauseContent, IsErrorMessage: false)]); 1085consoleLogsChannel.Writer.TryWrite([new ResourceLogLine(4, resumeContent, IsErrorMessage: false)]);
Pages\ResourcesTests.cs (2)
120channel.Writer.TryWrite([ 519channel.Writer.TryWrite(new[]
tests\Shared\TestDashboardClient.cs (1)
171await _sendInteractionUpdateChannel.Writer.WriteAsync(request, cancellationToken);
tests\Shared\TestDashboardTelemetrySender.cs (2)
23ContextChannel.Writer.TryWrite(context); 28ContextChannel.Writer.Complete();
Aspire.Dashboard.Tests (26)
ChannelExtensionsTests.cs (11)
60channel.Writer.TryWrite(["a", "b", "c"]); 84channel.Writer.TryWrite(["a", "b", "c"]); 110channel.Writer.TryWrite(["a", "b", "c"]); 119resultChannel.Writer.TryWrite(batch); 124resultChannel.Writer.Complete(); 133channel.Writer.TryWrite(["d", "e", "f"]); 141channel.Writer.Complete(); 154channel.Writer.TryWrite(["a", "b", "c"]); 163resultChannel.Writer.TryWrite(batch); 168resultChannel.Writer.Complete(); 177channel.Writer.TryWrite(["d", "e", "f"]);
Integration\DashboardClientAuthTests.cs (1)
180testCalls.ResourceInformationCallsChannel.Writer.TryWrite(new ReceivedCallInfo<ApplicationInformationRequest>(request, context.RequestHeaders));
ResourceOutgoingPeerResolverTests.cs (10)
292await resultChannel.Writer.WriteAsync((++changeCount, Stopwatch.GetTimestamp())); 310await sourceChannel.Writer.WriteAsync(new ResourceViewModelChange(ResourceViewModelChangeType.Upsert, CreateResource("test2", serviceAddress: "localhost", servicePort: 8080, state: KnownResourceState.Starting))); 320await sourceChannel.Writer.WriteAsync(new ResourceViewModelChange(ResourceViewModelChangeType.Upsert, CreateResource("test2", serviceAddress: "localhost", servicePort: 8081, state: KnownResourceState.Starting))); 329await sourceChannel.Writer.WriteAsync(new ResourceViewModelChange(ResourceViewModelChangeType.Upsert, CreateResource("test2", serviceAddress: "localhost", servicePort: 8081, state: KnownResourceState.Running))); 333resultChannel.Writer.Complete(); 365sourceChannel.Writer.Complete(); 391sourceChannel.Writer.Complete(); 414await sourceChannel.Writer.WriteAsync([new ResourceViewModelChange(ResourceViewModelChangeType.Upsert, CreateResource("test", state: KnownResourceState.Starting))]); 415await sourceChannel.Writer.WriteAsync([new ResourceViewModelChange(ResourceViewModelChangeType.Upsert, CreateResource("test", state: KnownResourceState.Running))]); 417sourceChannel.Writer.Complete();
TelemetryRepositoryTests\LogTests.cs (1)
978resultChannel.Writer.TryWrite(callCount);
tests\Shared\TestDashboardClient.cs (1)
171await _sendInteractionUpdateChannel.Writer.WriteAsync(request, cancellationToken);
tests\Shared\TestDashboardTelemetrySender.cs (2)
23ContextChannel.Writer.TryWrite(context); 28ContextChannel.Writer.Complete();
Aspire.Hosting (34)
ApplicationModel\ResourceLoggerService.cs (7)
240channel.Writer.TryWrite(new(name, hasSubscribers)); 266channel.Writer.Complete(); 322channel.Writer.TryWrite(logLines); 334channel.Writer.Complete(); 462using var _ = _logStreamCts.Token.Register(() => channel.Writer.TryComplete()); 465void Log(LogEntry log) => channel.Writer.TryWrite(log); 503channel.Writer.TryComplete();
ApplicationModel\ResourceNotificationService.cs (2)
766channel.Writer.TryWrite(resourceEvent); 814channel.Writer.TryComplete();
Backchannel\AuxiliaryBackchannelRpcTarget.cs (2)
1669await channel.Writer.WriteAsync(resourceLogLine, logStreamCancellationToken).ConfigureAwait(false); 1685completeWriterTask = Task.WhenAll(tasks).ContinueWith(_ => channel.Writer.Complete(), CancellationToken.None, TaskContinuationOptions.None, TaskScheduler.Default);
Backchannel\BackchannelLoggerProvider.cs (3)
41channel.Writer.TryComplete(); 61subscriber.Writer.TryWrite(entry); 77subscriber.Writer.TryComplete();
Dashboard\ResourcePublisher.cs (1)
106await channel.Writer.WriteAsync(new(changeType, snapshot), cancellationToken).ConfigureAwait(false);
Dcp\DcpResourceWatcher.cs (2)
140_logInformationChannel.Writer.TryWrite(new(subscribers.Name, LogsAvailable: null, subscribers.AnySubscribers, ShouldStartStream: true)); 363_logInformationChannel.Writer.TryWrite(new(resource.Metadata.Name, LogsAvailable: true, HasSubscribers: null, ShouldStartStream: shouldStartStream));
Dcp\ResourceLogSource.cs (4)
84var succeeded = channel.Writer.TryWrite(new ResourceLogEntry(line, lineIsError, timestamp, rawContent)); 88channel.Writer.TryComplete(); 100channel.Writer.TryComplete(ex); 135channel.Writer.TryComplete();
Devcontainers\DevcontainerSettingsWriter.cs (2)
51_portUpdates.Writer.TryWrite(new PortForwardEntry(url, port, protocol, label, openBrowser)); 273_portUpdates.Writer.TryComplete();
InteractionService.cs (2)
651channel.Writer.TryWrite(resourceEvent); 681channel.Writer.TryComplete();
Pipelines\PipelineActivityReporter.cs (9)
78await ActivityItemUpdated.Writer.WriteAsync(state, cancellationToken).ConfigureAwait(false); 115await ActivityItemUpdated.Writer.WriteAsync(state, cancellationToken).ConfigureAwait(false); 139await ActivityItemUpdated.Writer.WriteAsync(state, cancellationToken).ConfigureAwait(false); 172await ActivityItemUpdated.Writer.WriteAsync(state, cancellationToken).ConfigureAwait(false); 205ActivityItemUpdated.Writer.TryWrite(state); 246await ActivityItemUpdated.Writer.WriteAsync(state, cancellationToken).ConfigureAwait(false); 277await ActivityItemUpdated.Writer.WriteAsync(state, cancellationToken).ConfigureAwait(false); 369await ActivityItemUpdated.Writer.WriteAsync(activity, cancellationToken).ConfigureAwait(false); 400await ActivityItemUpdated.Writer.WriteAsync(activity, cancellationToken).ConfigureAwait(false);
Aspire.Hosting.Azure (1)
AzureProvisioningController.cs (1)
1413await _operationChannel.Writer.WriteAsync(queuedOperation, cancellationToken).ConfigureAwait(false);
Aspire.Hosting.Azure.Tests (5)
tests\Shared\TestInteractionService.cs (5)
40Interactions.Writer.TryWrite(data); 48Interactions.Writer.TryWrite(data); 63Interactions.Writer.TryWrite(data); 70Interactions.Writer.TryWrite(data); 86Interactions.Writer.TryWrite(data);
Aspire.Hosting.Browsers.Tests (5)
tests\Shared\TestInteractionService.cs (5)
40Interactions.Writer.TryWrite(data); 48Interactions.Writer.TryWrite(data); 63Interactions.Writer.TryWrite(data); 70Interactions.Writer.TryWrite(data); 86Interactions.Writer.TryWrite(data);
Aspire.Hosting.DevTunnels.Tests (5)
tests\Shared\TestInteractionService.cs (5)
40Interactions.Writer.TryWrite(data); 48Interactions.Writer.TryWrite(data); 63Interactions.Writer.TryWrite(data); 70Interactions.Writer.TryWrite(data); 86Interactions.Writer.TryWrite(data);
Aspire.Hosting.Foundry (2)
FoundryExtensions.cs (2)
408return await FoundryLocalService.DownloadModelAsync(model, progress => progressChannel.Writer.TryWrite(progress), ct).ConfigureAwait(false); 412progressChannel.Writer.TryComplete();
Aspire.Hosting.RemoteHost.Tests (5)
tests\Shared\TestInteractionService.cs (5)
40Interactions.Writer.TryWrite(data); 48Interactions.Writer.TryWrite(data); 63Interactions.Writer.TryWrite(data); 70Interactions.Writer.TryWrite(data); 86Interactions.Writer.TryWrite(data);
Aspire.Hosting.Tests (48)
Cli\CliOrphanDetectorTests.cs (2)
155Assert.True(processRunningChannel.Writer.TryWrite(++processRunningCallCounter)); 226Assert.True(processRunningChannel.Writer.TryWrite(++processRunningCallCounter));
Dashboard\DashboardEventHandlersTests.cs (2)
42testSink.MessageLogged += c => logChannel.Writer.TryWrite(c); 95testSink.MessageLogged += c => logChannel.Writer.TryWrite(c);
Dashboard\DashboardServiceTests.cs (2)
80await getConsoleLogsChannel.Writer.WriteAsync([LogEntry.Create(null, "Test3", isErrorMessage: false)]); 88getConsoleLogsChannel.Writer.TryComplete();
Dcp\DcpExecutorTests.cs (9)
144await channel.Writer.WriteAsync(context.DcpResourceName); 1495if (!logStreamPipesChannel.Writer.TryWrite((logStreamType, s))) 2093followStdErrPipeChannel.Writer.TryWrite(pipe); 3354logStreamPipesChannel.Writer.Complete(); 3762allocatedPortChannel.Writer.TryWrite(allocatedEndpoint.Port); 3774connectionStringAvailableChannel.Writer.TryWrite(context.Resource); 3832connectionStringAvailableChannel.Writer.TryWrite(context.Resource); 3916resolvedUrlChannel.Writer.TryWrite(url); 3958resolvedUrlChannel.Writer.TryWrite(url);
Dcp\TestKubernetesService.cs (7)
114c.Writer.TryWrite((WatchEventType.Added, Copy(res))); 117c.Writer.TryWrite((WatchEventType.Modified, Copy(modifiedResource))); 140c.Writer.TryWrite((WatchEventType.Modified, Copy(resource))); 155c.Writer.TryWrite((eventType, Copy(resource))); 186c.Writer.TryWrite((WatchEventType.Added, Copy(res))); 292chan.Writer.TryWrite((WatchEventType.Added, Copy(res))); 436_ = c.Writer.TryComplete();
DistributedApplicationTests.cs (1)
1212await beforeResourceStartedEvents.Writer.WriteAsync(e, ct);
Health\ResourceHealthCheckServiceTests.cs (2)
153channel.Writer.TryWrite(@event); 300await channel.Writer.WriteAsync(timeProvider.GetUtcNow());
InteractionServiceTests.cs (3)
131await updates.Writer.WriteAsync(interaction); 904await updates.Writer.WriteAsync(interaction); 957await updates.Writer.WriteAsync(interaction);
ResourceCommandServiceTests.cs (4)
146await commandResourcesChannel.Writer.WriteAsync(e.ResourceName); 155commandResourcesChannel.Writer.Complete(); 184await commandResourcesChannel.Writer.WriteAsync(e.ResourceName); 193commandResourcesChannel.Writer.Complete();
ResourceLoggerServiceTests.cs (6)
264consoleLogsChannel0.Writer.TryWrite([LogEntry.Create(timestamp: null, logMessage: "instance0!", isErrorMessage: false)]); 265consoleLogsChannel0.Writer.Complete(); 268consoleLogsChannel1.Writer.TryWrite([LogEntry.Create(timestamp: null, logMessage: "instance1!", isErrorMessage: false)]); 269consoleLogsChannel1.Writer.Complete(); 483consoleLogsChannel.Writer.TryWrite([CreateLogEntry("dcp-snapshot-log")]); 484consoleLogsChannel.Writer.Complete();
tests\Shared\TestInteractionService.cs (5)
40Interactions.Writer.TryWrite(data); 48Interactions.Writer.TryWrite(data); 63Interactions.Writer.TryWrite(data); 70Interactions.Writer.TryWrite(data); 86Interactions.Writer.TryWrite(data);
VersionChecking\VersionCheckServiceTests.cs (5)
99interactionService.Interactions.Writer.Complete(); 183interactionService.Interactions.Writer.Complete(); 214interactionService.Interactions.Writer.Complete(); 243interactionService.Interactions.Writer.Complete(); 284interactionService.Interactions.Writer.Complete();
Aspire.Hosting.TestUtilities (4)
Utils\Grpc\TestAsyncStreamReader.cs (2)
24if (!_channel.Writer.TryWrite(message)) 32_channel.Writer.Complete(ex);
Utils\Grpc\TestServerStreamWriter.cs (2)
25_channel.Writer.Complete(ex); 52if (!_channel.Writer.TryWrite(message))
Aspire.TerminalHost (2)
DcpUpstreamAdapter.cs (2)
400await _outputChannel.Writer.WriteAsync(payload, ct).ConfigureAwait(false); 462_outputChannel.Writer.TryComplete(error);
dotnet (2)
Commands\Test\MTP\TestApplicationActionQueue.cs (2)
58if (!_channel.Writer.TryWrite(testApplication)) 67_channel.Writer.Complete();
dotnet-aot (2)
src\sdk\src\Cli\dotnet\Commands\Test\MTP\TestApplicationActionQueue.cs (2)
58if (!_channel.Writer.TryWrite(testApplication)) 67_channel.Writer.Complete();
dotnet-watch (1)
UI\SpectreBuildParametersSelectionPrompt.cs (1)
125=> _channel.Writer.TryWrite(key);
GenerateDocumentationAndConfigFiles (7)
src\roslyn\src\Dependencies\Threading\ProducerConsumer.cs (5)
269args.channel.Writer.TryWrite(item); 276channel.Writer, 336static (obj, cancellationToken) => ((Channel<TItem>)obj!).Writer.TryComplete(new OperationCanceledException(cancellationToken)), 367await produceItems(item => channel.Writer.TryWrite(item), args, cancellationToken).ConfigureAwait(false); 370channel.Writer,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IAsyncEnumerableExtensions.cs (2)
48tasks[i] = ProcessAsync(streams[i], channel.Writer, cancellationToken); 75static (task, channel) => ((Channel<T>)channel!).Writer.Complete(task.Exception),
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.Transport.DirectTls (4)
Connection\DirectTlsConnectionListener.cs (4)
133_readyConnections.Writer, 159_readyConnections.Writer.TryComplete(error); 192_readyConnections.Writer.TryComplete(); 232_readyConnections.Writer.TryComplete();
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)
1967closeMessage = await ProcessMessagesAsync(message, connectionState, invocationMessageChannel.Writer).ConfigureAwait(false); 2019invocationMessageChannel.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)
110_channel.Writer.TryComplete(new InvalidOperationException("Server provided a result in a completion response to a streamed invocation.")); 125_channel.Writer.TryComplete(); 139_channel.Writer.TryComplete(exception); 146while (!_channel.Writer.TryWrite(item)) 148if (!await _channel.Writer.WaitToWriteAsync().ConfigureAwait(false)) 170_channel.Writer.TryComplete(new OperationCanceledException());
src\aspnetcore\src\SignalR\common\Shared\MessageBuffer.cs (1)
214_waitForAck.Writer.TryWrite(newCount);
Microsoft.AspNetCore.SignalR.Core (5)
Internal\ChannelBasedSemaphore.cs (2)
20_channel.Writer.TryWrite(1); 37if (!_channel.Writer.TryWrite(1))
src\aspnetcore\src\SignalR\common\Shared\MessageBuffer.cs (1)
214_waitForAck.Writer.TryWrite(newCount);
StreamTracker.cs (2)
159return _channel.Writer.WriteAsync((T?)o).AsTask(); 164_channel.Writer.TryComplete(ex);
Microsoft.Build.Tasks.Core (4)
AssemblyDependency\Node\RarNodeBuildEngine.cs (4)
152_ = _eventCountChannel.Writer.TryWrite(_pendingCount); 157_ = _eventCountChannel.Writer.TryWrite(0); 168_ = _eventChannel.Writer.TryWrite(e); 174_ = _eventCountChannel.Writer.TryWrite(_pendingCount);
Microsoft.CodeAnalysis.Analyzers (7)
src\roslyn\src\Dependencies\Threading\ProducerConsumer.cs (5)
269args.channel.Writer.TryWrite(item); 276channel.Writer, 339() => channel.Writer.TryComplete(new OperationCanceledException(cancellationToken))); 367await produceItems(item => channel.Writer.TryWrite(item), args, cancellationToken).ConfigureAwait(false); 370channel.Writer,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IAsyncEnumerableExtensions.cs (2)
48tasks[i] = ProcessAsync(streams[i], channel.Writer, cancellationToken); 75static (task, channel) => ((Channel<T>)channel!).Writer.Complete(task.Exception),
Microsoft.CodeAnalysis.AnalyzerUtilities (7)
src\roslyn\src\Dependencies\Threading\ProducerConsumer.cs (5)
269args.channel.Writer.TryWrite(item); 276channel.Writer, 339() => channel.Writer.TryComplete(new OperationCanceledException(cancellationToken))); 367await produceItems(item => channel.Writer.TryWrite(item), args, cancellationToken).ConfigureAwait(false); 370channel.Writer,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IAsyncEnumerableExtensions.cs (2)
48tasks[i] = ProcessAsync(streams[i], channel.Writer, cancellationToken); 75static (task, channel) => ((Channel<T>)channel!).Writer.Complete(task.Exception),
Microsoft.CodeAnalysis.CodeStyle (7)
src\roslyn\src\Dependencies\Threading\ProducerConsumer.cs (5)
269args.channel.Writer.TryWrite(item); 276channel.Writer, 339() => channel.Writer.TryComplete(new OperationCanceledException(cancellationToken))); 367await produceItems(item => channel.Writer.TryWrite(item), args, cancellationToken).ConfigureAwait(false); 370channel.Writer,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IAsyncEnumerableExtensions.cs (2)
48tasks[i] = ProcessAsync(streams[i], channel.Writer, cancellationToken); 75static (task, channel) => ((Channel<T>)channel!).Writer.Complete(task.Exception),
Microsoft.CodeAnalysis.ResxSourceGenerator (7)
src\roslyn\src\Dependencies\Threading\ProducerConsumer.cs (5)
269args.channel.Writer.TryWrite(item); 276channel.Writer, 339() => channel.Writer.TryComplete(new OperationCanceledException(cancellationToken))); 367await produceItems(item => channel.Writer.TryWrite(item), args, cancellationToken).ConfigureAwait(false); 370channel.Writer,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IAsyncEnumerableExtensions.cs (2)
48tasks[i] = ProcessAsync(streams[i], channel.Writer, cancellationToken); 75static (task, channel) => ((Channel<T>)channel!).Writer.Complete(task.Exception),
Microsoft.CodeAnalysis.Workspaces (7)
src\roslyn\src\Dependencies\Threading\ProducerConsumer.cs (5)
269args.channel.Writer.TryWrite(item); 276channel.Writer, 336static (obj, cancellationToken) => ((Channel<TItem>)obj!).Writer.TryComplete(new OperationCanceledException(cancellationToken)), 367await produceItems(item => channel.Writer.TryWrite(item), args, cancellationToken).ConfigureAwait(false); 370channel.Writer,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IAsyncEnumerableExtensions.cs (2)
48tasks[i] = ProcessAsync(streams[i], channel.Writer, cancellationToken); 75static (task, channel) => ((Channel<T>)channel!).Writer.Complete(task.Exception),
Microsoft.DotNet.HotReload.Utils.Generator (2)
Util\FSWGen.cs (2)
30_channel?.Writer.WriteAsync (eventArgs).AsTask().Wait(); 46_channel?.Writer.Complete();
Microsoft.DotNet.HotReload.Watch (1)
Aspire\AspireServiceFactory.cs (1)
135var writeResult = outputChannel.Writer.TryWrite(line);
Microsoft.Extensions.AI (2)
ChatCompletion\AnonymousDelegatingChatClient.cs (2)
146await updates.Writer.WriteAsync(update, cancellationToken); 157_ = updates.Writer.TryComplete(error);
Microsoft.Extensions.ServiceDiscovery.Tests (1)
ServiceEndpointResolverTests.cs (1)
267watcher.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));
Roslyn.Diagnostics.Analyzers (7)
src\roslyn\src\Dependencies\Threading\ProducerConsumer.cs (5)
269args.channel.Writer.TryWrite(item); 276channel.Writer, 339() => channel.Writer.TryComplete(new OperationCanceledException(cancellationToken))); 367await produceItems(item => channel.Writer.TryWrite(item), args, cancellationToken).ConfigureAwait(false); 370channel.Writer,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IAsyncEnumerableExtensions.cs (2)
48tasks[i] = ProcessAsync(streams[i], channel.Writer, cancellationToken); 75static (task, channel) => ((Channel<T>)channel!).Writer.Complete(task.Exception),
Stress.ApiService (4)
ProducerConsumer.cs (2)
63await _channel.Writer.WriteAsync(data); 65_channel.Writer.Complete();
Program.cs (2)
304channel.Writer.TryWrite($"Logged {logCount} messages."); 310channel.Writer.Complete();
System.Diagnostics.Process (3)
System\Diagnostics\Process.Multiplexing.cs (3)
577await channel.Writer.WriteAsync(new ProcessOutputLine(line, standardError), ct).ConfigureAwait(false); 582channel.Writer.TryComplete(ex); 588channel.Writer.TryComplete();
System.IO.FileSystem.Watcher (3)
System\IO\FileSystemWatcher.Linux.cs (3)
1095_eventQueue.Writer.Complete(); 1227_eventQueue.Writer.TryWrite(ev); 1236_eventQueue.Writer.TryWrite(WatcherEvent.Error(exception));
System.Net.Http (2)
System\Net\Http\SocketsHttpHandler\Http2Connection.cs (2)
1210if (!_writeChannel.Writer.TryWrite(writeEntry)) 1941bool completed = _writeChannel.Writer.TryComplete();
System.Net.Quic (9)
System\Net\Quic\QuicConnection.cs (5)
661_acceptQueue.Writer.TryComplete(exception); 672_acceptQueue.Writer.TryComplete(exception); 686_acceptQueue.Writer.TryComplete(exception); 712if (!_acceptQueue.Writer.TryWrite(stream)) 863_acceptQueue.Writer.TryComplete(ExceptionDispatchInfo.SetCurrentStackTrace(new ObjectDisposedException(GetType().FullName)));
System\Net\Quic\QuicListener.cs (4)
248if (!_acceptQueue.Writer.TryWrite(connection)) 280if (!_acceptQueue.Writer.TryWrite(ex)) 315if (!_acceptQueue.Writer.TryWrite( 432_acceptQueue.Writer.TryComplete(ExceptionDispatchInfo.SetCurrentStackTrace(new ObjectDisposedException(GetType().FullName)));
System.Threading.Channels (2)
System\Threading\Channels\Channel_2.cs (1)
26public static implicit operator ChannelWriter<TWrite>(Channel<TWrite, TRead> channel) => channel.Writer;
System\Threading\Channels\RendezvousChannel.cs (1)
487$"{((RendezvousChannelReader)Reader).DebuggerDisplay}, {((RendezvousChannelWriter)Writer).DebuggerDisplay}";