Beispiel #1
0
        public async Task LazyLoading()//延时加载
        {
            await locker.WaitAsync();

            try
            {
                foreach (var server in _localConfiguration.LoginServerInfoList)
                {
                    List <Task> lttask = new List <Task>();
                    lttask.Add(_databaseComponent.LoadHardwave(server.IP));
                    lttask.Add(_databaseComponent.GetMeasureUnit(server.IP));
                    await Task.WhenAll(lttask.ToArray());
                }

                _hardwareService.InitServers(_localConfiguration.LoginServerInfoList);
                _signalProcess.LazyInitSignals();
            }
            finally
            {
                locker.Release();
            }
        }