private async Task StartWorkerAsync()
        {
            var cancellationToken = ThreadingContext.DisposalToken;

            _workQueueSource.SetResult(
                new AsyncBatchingWorkQueue <DocumentAndComments>(
                    TimeSpan.FromSeconds(1),
                    ProcessTodoCommentInfosAsync,
                    cancellationToken));

            var client = await RemoteHostClient.TryGetClientAsync(_workspace, cancellationToken).ConfigureAwait(false);

            if (client == null)
            {
                ComputeTodoCommentsInCurrentProcess(cancellationToken);
                return;
            }

            // Pass ourselves in as the callback target for the OOP service.  As it discovers
            // todo comments it will call back into us to notify VS about it.
            _lazyConnection = await client.CreateConnectionAsync <IRemoteTodoCommentsDiscoveryService>(callbackTarget : this, cancellationToken).ConfigureAwait(false);

            // Now that we've started, let the VS todo list know to start listening to us
            _eventListenerTracker.EnsureEventListener(_workspace, this);

            // Now kick off scanning in the OOP process.
            // If the call fails an error has already been reported and there is nothing more to do.
            _ = await _lazyConnection.TryInvokeAsync(
                (service, cancellationToken) => service.ComputeTodoCommentsAsync(cancellationToken),
                cancellationToken).ConfigureAwait(false);
        }
示例#2
0
 public RemoteUpdateEngine(
     Workspace workspace,
     RemoteServiceConnection session)
 {
     _workspace = workspace;
     _session   = session;
 }
        private async Task StartWorkerAsync()
        {
            var cancellationToken = ThreadingContext.DisposalToken;

            var client = await RemoteHostClient
                         .TryGetClientAsync(_workspace, cancellationToken)
                         .ConfigureAwait(false);

            if (client == null)
            {
                return;
            }

            // Pass ourselves in as the callback target for the OOP service.  As it discovers
            // designer attributes it will call back into us to notify VS about it.
            _lazyConnection = client.CreateConnection <IRemoteProjectTelemetryService>(
                callbackTarget: this
                );

            // Now kick off scanning in the OOP process.
            // If the call fails an error has already been reported and there is nothing more to do.
            _ = await _lazyConnection
                .TryInvokeAsync(
                (service, callbackId, cancellationToken) =>
                service.ComputeProjectTelemetryAsync(callbackId, cancellationToken),
                cancellationToken
                )
                .ConfigureAwait(false);
        }
示例#4
0
 internal PythiaRemoteServiceConnectionWrapper(RemoteServiceConnection <TService> underlyingObject)
 => UnderlyingObject = underlyingObject;
 public RemoteUpdateEngine(RemoteServiceConnection <IRemoteSymbolSearchUpdateService> connection)
 => _connection = connection;
示例#6
0
 internal UnitTestingRemoteServiceConnectionWrapper(RemoteServiceConnection <TService> underlyingObject)
 => UnderlyingObject = underlyingObject;
示例#7
0
 internal UnitTestingKeepAliveSessionWrapper(RemoteServiceConnection underlyingObject)
 => UnderlyingObject = underlyingObject;