예제 #1
0
        public async Task EnsureBrokerStartedAsync(string name, IServiceContainer services)
        {
            var lockToken = await _connectLock.WaitAsync();

            try {
                if (!lockToken.IsSet)
                {
                    _process = new RemoteBrokerProcess(name, _logFolder, services.FileSystem(), services.GetService <IRInstallationService>(), services.Process());
                    await _process.StartAsync(() => {
                        _process = null;
                        _connectLock.EnqueueReset();
                    });
                }
                lockToken.Set();
            } finally {
                lockToken.Reset();
            }
        }
예제 #2
0
        public async Task EnsureBrokerStartedAsync(string name)
        {
            var lockToken = await _connectLock.WaitAsync();

            try {
                if (!lockToken.IsSet)
                {
                    _process = new RemoteBrokerProcess(name, _logFolder, _fileSystem, _installations, _processService);
                    await _process.StartAsync(() => {
                        _process = null;
                        _connectLock.EnqueueReset();
                    });
                }
                lockToken.Set();
            } finally {
                lockToken.Reset();
            }
        }