3 implementations of IAppHostAuxiliaryBackchannel
aspire (1)
Backchannel\AppHostAuxiliaryBackchannel.cs (1)
21internal sealed class AppHostAuxiliaryBackchannel : IAppHostAuxiliaryBackchannel
Aspire.Cli.Tests (2)
Commands\TerminalCommandTests.cs (1)
807private sealed class CapturingTerminalAppHostBackchannel : IAppHostAuxiliaryBackchannel
TestServices\TestAppHostAuxiliaryBackchannel.cs (1)
16internal sealed class TestAppHostAuxiliaryBackchannel : IAppHostAuxiliaryBackchannel
155 references to IAppHostAuxiliaryBackchannel
aspire (116)
Backchannel\AppHostConnectionHelper.cs (6)
17public static IAppHostAuxiliaryBackchannel? FindConnectionByAppHostPath( 18IEnumerable<IAppHostAuxiliaryBackchannel> connections, 33public static async Task<IAppHostAuxiliaryBackchannel?> GetSelectedConnectionAsync( 52var selectedConnection = FindSelectedConnection(connections, selectedPath, logger); 104private static IAppHostAuxiliaryBackchannel? FindSelectedConnection( 105IEnumerable<IAppHostAuxiliaryBackchannel> connections,
Backchannel\AppHostConnectionResolver.cs (6)
24public IAppHostAuxiliaryBackchannel? Connection { get; init; } 205IAppHostAuxiliaryBackchannel? selectedConnection = null; 291private static bool IsInWorktreeOfWorkingDirectory(IAppHostAuxiliaryBackchannel connection, string workingDirectory) 324private async Task<IAppHostAuxiliaryBackchannel?> PromptForAppHostSelectionAsync( 325List<IAppHostAuxiliaryBackchannel> candidateConnections, 350var selectedConnection = choices.FirstOrDefault(c => c.Display == selectedDisplay).Connection;
Backchannel\AuxiliaryBackchannelMonitor.cs (11)
58public IEnumerable<IAppHostAuxiliaryBackchannel> Connections => 61public async IAsyncEnumerable<IReadOnlyList<IAppHostAuxiliaryBackchannel>> WatchConnectionsAsync([EnumeratorCancellation] CancellationToken cancellationToken = default, bool readOnly = false) 68HashSet<IAppHostAuxiliaryBackchannel>? previousConnections = null; 98var previousConnections = new HashSet<IAppHostAuxiliaryBackchannel>(initialConnections, ReferenceEqualityComparer.Instance); 165public IAppHostAuxiliaryBackchannel? SelectedConnection 170var connection = SelectConnection(Connections, ref selectedAppHostPath); 191internal static IAppHostAuxiliaryBackchannel? SelectConnection( 192IEnumerable<IAppHostAuxiliaryBackchannel> connections, 206var selectedConnection = candidates.FirstOrDefault(c => 234public IReadOnlyList<IAppHostAuxiliaryBackchannel> GetConnectionsForWorkingDirectory(DirectoryInfo workingDirectory) 750private static async Task DisconnectAsync(IAppHostAuxiliaryBackchannel connection)
Backchannel\IAuxiliaryBackchannelMonitor.cs (3)
14IEnumerable<IAppHostAuxiliaryBackchannel> Connections { get; } 26IReadOnlyList<IAppHostAuxiliaryBackchannel> GetConnectionsForWorkingDirectory(DirectoryInfo workingDirectory); 43IAsyncEnumerable<IReadOnlyList<IAppHostAuxiliaryBackchannel>> WatchConnectionsAsync(CancellationToken cancellationToken = default, bool readOnly = false);
Backchannel\OrphanedAppHostCollector.cs (3)
24List<IAppHostAuxiliaryBackchannel> orphans; 46foreach (var connection in orphans) 88internal static bool IsOrphaned(IAppHostAuxiliaryBackchannel connection)
Backchannel\ResourceSnapshotWatcher.cs (2)
18private readonly IAppHostAuxiliaryBackchannel _connection; 31IAppHostAuxiliaryBackchannel connection,
Backchannel\ResourceWaitService.cs (4)
49IAppHostAuxiliaryBackchannel connection, 66IAppHostAuxiliaryBackchannel connection, 89IAppHostAuxiliaryBackchannel connection, 141IAppHostAuxiliaryBackchannel connection,
Backchannel\TrayResourceHealthSubscription.cs (2)
19IAppHostAuxiliaryBackchannel connection, 34IAppHostAuxiliaryBackchannel connection,
Backchannel\TrayWatchStream.cs (11)
28private readonly HashSet<IAppHostAuxiliaryBackchannel> _pendingDashboardLookups = new(ReferenceEqualityComparer.Instance); 32private readonly Dictionary<IAppHostAuxiliaryBackchannel, string?> _dashboardUrls = new(ReferenceEqualityComparer.Instance); 50var healthSubscriptions = new Dictionary<IAppHostAuxiliaryBackchannel, TrayResourceHealthSubscription>(ReferenceEqualityComparer.Instance); 51List<(IAppHostAuxiliaryBackchannel Connection, TrayAppHost Host)> candidates = []; 202foreach (var connection in connections.Current) 222var currentConnections = new Dictionary<IAppHostAuxiliaryBackchannel, TrayAppHost>(ReferenceEqualityComparer.Instance); 244foreach (var connection in _dashboardUrls.Keys.ToArray()) 312List<(IAppHostAuxiliaryBackchannel Connection, TrayAppHost Host)> candidates, 334var connection = candidates[index].Connection; 401private bool TryBeginDashboardLookup(IAppHostAuxiliaryBackchannel connection) 409private void CompleteDashboardLookup(IAppHostAuxiliaryBackchannel connection)
Commands\AgentMcpCommand.cs (2)
403private Task<IAppHostAuxiliaryBackchannel?> GetSelectedConnectionAsync(CancellationToken cancellationToken) 411var connection = await GetSelectedConnectionAsync(cancellationToken).ConfigureAwait(false);
Commands\AppHostFollowDisconnectHelpers.cs (2)
19internal static bool HasAppHostExited(IAppHostAuxiliaryBackchannel connection) 48internal static void WriteStatusMessage(IInteractionService interactionService, IAppHostAuxiliaryBackchannel connection)
Commands\AppHostLauncher.cs (7)
427private record LaunchResult(IProcessExecution? ChildProcess, IAppHostAuxiliaryBackchannel? Backchannel, DashboardUrlsState? DashboardUrls, bool ChildExitedEarly, int ChildExitCode, DateTimeOffset? ChildStartedAt = null); 494IAppHostAuxiliaryBackchannel? connection = null; 667internal static bool IsLaunchedByChildCli(IAppHostAuxiliaryBackchannel candidate, int childProcessId, long? childStableStartedAt) 701IAppHostAuxiliaryBackchannel candidate, 750internal static async Task<bool?> WaitForAppHostReadyAsync(IAppHostAuxiliaryBackchannel connection, CancellationToken cancellationToken) 757IAppHostAuxiliaryBackchannel connection, 786IAppHostAuxiliaryBackchannel connection,
Commands\DescribeCommand.cs (1)
156var connection = result.Connection!;
Commands\ExportCommand.cs (2)
137IAppHostAuxiliaryBackchannel? connection, 252IAppHostAuxiliaryBackchannel connection,
Commands\LogsCommand.cs (5)
173var connection = result.Connection!; 233IAppHostAuxiliaryBackchannel connection, 297IAppHostAuxiliaryBackchannel connection, 375IAppHostAuxiliaryBackchannel connection, 416IAppHostAuxiliaryBackchannel connection,
Commands\McpCallCommand.cs (1)
71var connection = result.Connection!;
Commands\McpToolsCommand.cs (1)
57var connection = result.Connection!;
Commands\PsCommand.cs (6)
208private async Task<List<IAppHostAuxiliaryBackchannel>> ScanForConnectionsAsync(CancellationToken cancellationToken) 223private sealed record ConnectionsUpdate(IReadOnlyList<IAppHostAuxiliaryBackchannel> Connections) : PsFollowUpdate; 367private static List<IAppHostAuxiliaryBackchannel> OrderConnections(IEnumerable<IAppHostAuxiliaryBackchannel> connections) 374private async Task<List<AppHostDisplayInfo>> GatherAppHostInfosAsync(List<IAppHostAuxiliaryBackchannel> connections, CancellationToken cancellationToken) 378foreach (var connection in connections)
Commands\ResourceCommand.cs (7)
143var connection = result.Connection!; 186IAppHostAuxiliaryBackchannel connection, 223private static async Task<ResourceSnapshotCommand?> GetCommandMetadataAsync(IAppHostAuxiliaryBackchannel connection, string resourceName, string commandName, bool includeHidden, CancellationToken cancellationToken) 234private static async Task<(string Name, string Description)[]> GetAvailableCommandMetadataAsync(IAppHostAuxiliaryBackchannel connection, string resourceName, bool includeHidden, CancellationToken cancellationToken) 643var connection = await ResolveConnectionForAvailableCommandsAsync(parseResult, cancellationToken).ConfigureAwait(false); 664private async Task<IAppHostAuxiliaryBackchannel?> ResolveConnectionForAvailableCommandsAsync(ParseResult parseResult, CancellationToken cancellationToken) 683private async Task<IAppHostAuxiliaryBackchannel?> ResolveExplicitConnectionForAvailableCommandsAsync(FileInfo appHostProjectFile, CancellationToken cancellationToken)
Commands\ResourceCommandHelper.cs (2)
32IAppHostAuxiliaryBackchannel connection, 64IAppHostAuxiliaryBackchannel connection,
Commands\StopCommand.cs (7)
211var connection = connections[0]; 327var connection = inScopeConnections[0].Connection!; 590private async Task<int> StopAppHostAsync(IAppHostAuxiliaryBackchannel connection, string appHostIdentifier, bool useConnectionOnly, CancellationToken cancellationToken) 639private string GetSingleAppHostDisplayPath(IAppHostAuxiliaryBackchannel connection) 652private static string GetAppHostPath(IAppHostAuxiliaryBackchannel connection) 659private static FileInfo? GetAppHostFile(IAppHostAuxiliaryBackchannel connection) 684private static string GetAppHostIdentifier(IAppHostAuxiliaryBackchannel connection, string displayPath, bool includeProcessId)
Commands\StopCommand.TrayProtocol.cs (1)
81var connection = matching[0];
Commands\TelemetryCommandHelpers.cs (2)
281var connection = result.Connection!; 793IAppHostAuxiliaryBackchannel? Connection,
Commands\TerminalAttachCommand.cs (2)
25/// list of terminal replicas via <see cref="IAppHostAuxiliaryBackchannel.GetTerminalInfoAsync"/>.</item> 104var connection = connectionResult.Connection!;
Commands\TerminalPsCommand.cs (2)
29/// <item>Calls <see cref="IAppHostAuxiliaryBackchannel.ListTerminalsAsync"/> to enumerate them. 112var connection = connectionResult.Connection!;
Commands\TerminalResourceResolver.cs (1)
17IAppHostAuxiliaryBackchannel connection,
Commands\WaitCommand.cs (2)
95var connection = result.Connection!; 101IAppHostAuxiliaryBackchannel connection,
Mcp\IMcpResourceToolRefreshService.cs (2)
22IAppHostAuxiliaryBackchannel? connection, 79IAppHostAuxiliaryBackchannel? Connection,
Mcp\McpResourceToolRefreshService.cs (3)
38IAppHostAuxiliaryBackchannel? connection, 54private bool IsSameConnection(IAppHostAuxiliaryBackchannel? connection) 88var connection = await AppHostConnectionHelper.GetSelectedConnectionAsync(_auxiliaryBackchannelMonitor, _logger, cancellationToken).ConfigureAwait(false);
Mcp\Tools\ExecuteResourceCommandTool.cs (1)
94var connection = await AppHostConnectionHelper.GetSelectedConnectionAsync(auxiliaryBackchannelMonitor, logger, cancellationToken).ConfigureAwait(false);
Mcp\Tools\ListConsoleLogsTool.cs (1)
67var connection = await AppHostConnectionHelper.GetSelectedConnectionAsync(auxiliaryBackchannelMonitor, logger, cancellationToken).ConfigureAwait(false);
Mcp\Tools\ListResourcesTool.cs (1)
145var connection = await AppHostConnectionHelper.GetSelectedConnectionAsync(
Mcp\Tools\McpToolHelpers.cs (4)
57var connection = await AppHostConnectionHelper.GetSelectedConnectionAsync(auxiliaryBackchannelMonitor, logger, cancellationToken).ConfigureAwait(false); 415IAppHostAuxiliaryBackchannel connection, 444var connection = await AppHostConnectionHelper.GetSelectedConnectionAsync(auxiliaryBackchannelMonitor, NullLogger.Instance, cancellationToken).ConfigureAwait(false); 457IAppHostAuxiliaryBackchannel connection,
Mcp\Tools\SelectAppHostTool.cs (1)
73IAppHostAuxiliaryBackchannel? matchingConnection;
Mcp\Tools\WaitForResourcesTool.cs (1)
91IAppHostAuxiliaryBackchannel? connection;
Projects\RunningInstanceManager.cs (1)
98public async Task<bool> StopAndMonitorAsync(IAppHostAuxiliaryBackchannel backchannel, CancellationToken cancellationToken)
Aspire.Cli.Tests (39)
Backchannel\AuxiliaryBackchannelMonitorTests.cs (7)
75var firstConnection = Assert.Single(watch.Current); 100var replacementConnection = Assert.Single(watch.Current); 131var result = AppHostConnectionHelper.FindConnectionByAppHostPath( 226var result = AppHostConnectionHelper.FindConnectionByAppHostPath( 288var firstConnection = Assert.Single(watch.Current); 305var secondConnection = Assert.Single(watch.Current, connection => !ReferenceEquals(connection, firstConnection)); 323var replacementConnection = Assert.Single(watch.Current);
Backchannel\TrayWatchStreamTests.cs (12)
53async IAsyncEnumerable<IReadOnlyList<IAppHostAuxiliaryBackchannel>> Watch([EnumeratorCancellation] CancellationToken token) 93async IAsyncEnumerable<IReadOnlyList<IAppHostAuxiliaryBackchannel>> Watch([EnumeratorCancellation] CancellationToken token) 112var snapshots = Channel.CreateUnbounded<IReadOnlyList<IAppHostAuxiliaryBackchannel>>(); 183async IAsyncEnumerable<IReadOnlyList<IAppHostAuxiliaryBackchannel>> Watch([EnumeratorCancellation] CancellationToken token) 257async IAsyncEnumerable<IReadOnlyList<IAppHostAuxiliaryBackchannel>> Watch([EnumeratorCancellation] CancellationToken token) 301async IAsyncEnumerable<IReadOnlyList<IAppHostAuxiliaryBackchannel>> Watch([EnumeratorCancellation] CancellationToken token) 484async IAsyncEnumerable<IReadOnlyList<IAppHostAuxiliaryBackchannel>> Watch([EnumeratorCancellation] CancellationToken token) 561var snapshots = Channel.CreateUnbounded<IReadOnlyList<IAppHostAuxiliaryBackchannel>>(); 666var snapshots = Channel.CreateUnbounded<IReadOnlyList<IAppHostAuxiliaryBackchannel>>(); 803var snapshots = Channel.CreateUnbounded<IReadOnlyList<IAppHostAuxiliaryBackchannel>>(); 865var snapshots = Channel.CreateUnbounded<IReadOnlyList<IAppHostAuxiliaryBackchannel>>(); 943async IAsyncEnumerable<IReadOnlyList<IAppHostAuxiliaryBackchannel>> Discover([EnumeratorCancellation] CancellationToken token)
Commands\TerminalCommandTests.cs (1)
804/// <see cref="IAppHostAuxiliaryBackchannel.GetTerminalInfoAsync"/>. All other calls
Mcp\AppHostConnectionSelectionLogicTests.cs (6)
53var selected = monitor.SelectedConnection; 163var selected = await AppHostConnectionHelper.GetSelectedConnectionAsync( 176var selected = await AppHostConnectionHelper.GetSelectedConnectionAsync(monitor, NullLogger.Instance, TestContext.Current.CancellationToken); 193var selected = await AppHostConnectionHelper.GetSelectedConnectionAsync(monitor, NullLogger.Instance, TestContext.Current.CancellationToken); 219var selected = await AppHostConnectionHelper.GetSelectedConnectionAsync(monitor, NullLogger.Instance, TestContext.Current.CancellationToken); 250var selected = await AppHostConnectionHelper.GetSelectedConnectionAsync(monitor, NullLogger.Instance, TestContext.Current.CancellationToken);
Mcp\MockPackagingService.cs (3)
45public IEnumerable<IAppHostAuxiliaryBackchannel> Connections => []; 51public async IAsyncEnumerable<IReadOnlyList<IAppHostAuxiliaryBackchannel>> WatchConnectionsAsync([EnumeratorCancellation] CancellationToken cancellationToken = default, bool readOnly = false) 57public IReadOnlyList<IAppHostAuxiliaryBackchannel> GetConnectionsForWorkingDirectory(DirectoryInfo workingDirectory)
Mcp\SelectAppHostToolTests.cs (1)
139var selectedConnection = await AppHostConnectionHelper.GetSelectedConnectionAsync(monitor, NullLogger.Instance, TestContext.Current.CancellationToken);
TestServices\TestAuxiliaryBackchannelMonitor.cs (9)
13private readonly ConcurrentDictionary<string, IAppHostAuxiliaryBackchannel> _connectionsBySocketPath = new(StringComparers.FileSystemPath); 16public IEnumerable<IAppHostAuxiliaryBackchannel> Connections => 29public Func<CancellationToken, IAsyncEnumerable<IReadOnlyList<IAppHostAuxiliaryBackchannel>>>? WatchConnectionsHandler { get; set; } 44public async IAsyncEnumerable<IReadOnlyList<IAppHostAuxiliaryBackchannel>> WatchConnectionsAsync([EnumeratorCancellation] CancellationToken cancellationToken = default, bool readOnly = false) 71public IAppHostAuxiliaryBackchannel? SelectedConnection 78var connection = AuxiliaryBackchannelMonitor.SelectConnection(Connections, ref selectedAppHostPath); 84public IReadOnlyList<IAppHostAuxiliaryBackchannel> GetConnectionsForWorkingDirectory(DirectoryInfo workingDirectory) 91public void AddConnection(string socketPath, IAppHostAuxiliaryBackchannel connection) 96public void AddConnection(string hash, string socketPath, IAppHostAuxiliaryBackchannel connection)