예제 #1
0
파일: WorkerRole.cs 프로젝트: ca-ta/Yams
        public async Task RunAsync()
        {
            WorkerRoleConfig config = new WorkerRoleConfig();
            YamsConfig yamsConfig = new YamsConfigBuilder(
                // mandatory configs
                config.StorageDataConnectionString,
                DeploymentIdUtils.CloudServiceDeploymentId,
                RoleEnvironment.CurrentRoleInstance.UpdateDomain.ToString(),
                RoleEnvironment.CurrentRoleInstance.Id,
                config.CurrentRoleInstanceLocalStoreDirectory)
                // optional configs
                .SetCheckForUpdatesPeriodInSeconds(config.UpdateFrequencyInSeconds)
                .SetApplicationRestartCount(config.ApplicationRestartCount)
                .Build();
            _yamsEntryPoint = new YamsEntryPoint(yamsConfig);

            try
            {
                Trace.TraceInformation("Yams is starting");
                await _yamsEntryPoint.Start();
                Trace.TraceInformation("Yams has started");
                while (true)
                {
                    await Task.Delay(1000);
                }
            }
            catch (Exception ex)
            {
                Trace.TraceError(ex.ToString());
            }
        }
예제 #2
0
        public async Task RunAsync()
        {
            WorkerRoleConfig config = new WorkerRoleConfig();
            YamsConfig yamsConfig = new YamsConfigBuilder(
                // mandatory configs
                DeploymentIdUtils.GetYamsClusterId(this.IsSingleClusterDeployment),
                RoleEnvironment.CurrentRoleInstance.UpdateDomain.ToString(),
                RoleEnvironment.CurrentRoleInstance.Id,
                config.CurrentRoleInstanceLocalStoreDirectory)
                // optional configs
                .SetCheckForUpdatesPeriodInSeconds(config.UpdateFrequencyInSeconds)
                .SetApplicationRestartCount(config.ApplicationRestartCount)
                .Build();
            _yamsService = YamsServiceFactory.Create(yamsConfig,
                deploymentRepositoryStorageConnectionString: config.StorageDataConnectionString,
                updateSessionStorageConnectionString: config.StorageDataConnectionString);

            try
            {
                Trace.TraceInformation("Yams is starting");
                await _yamsService.Start();
                Trace.TraceInformation("Yams has started. Looking for apps with deploymentId:" + yamsConfig.ClusterDeploymentId);
                while (true)
                {
                    await Task.Delay(1000);
                }
            }
            catch (Exception ex)
            {
                Trace.TraceError(ex.ToString());
            }
        }
예제 #3
0
        public async Task RunAsync()
        {
            WorkerRoleConfig config     = new WorkerRoleConfig();
            YamsConfig       yamsConfig = new YamsConfigBuilder(
                // mandatory configs
                config.StorageDataConnectionString,
                DeploymentIdUtils.CloudServiceDeploymentId,
                RoleEnvironment.CurrentRoleInstance.UpdateDomain.ToString(),
                RoleEnvironment.CurrentRoleInstance.Id,
                config.CurrentRoleInstanceLocalStoreDirectory)
                                          // optional configs
                                          .SetCheckForUpdatesPeriodInSeconds(config.UpdateFrequencyInSeconds)
                                          .SetApplicationRestartCount(config.ApplicationRestartCount)
                                          .Build();

            _yamsEntryPoint = new YamsEntryPoint(yamsConfig);

            try
            {
                Trace.TraceInformation("Yams is starting");
                await _yamsEntryPoint.Start();

                Trace.TraceInformation("Yams has started");
                while (true)
                {
                    await Task.Delay(1000);
                }
            }
            catch (Exception ex)
            {
                Trace.TraceError(ex.ToString());
            }
        }
예제 #4
0
파일: WorkerRole.cs 프로젝트: zhonli/Yams
        public async Task RunAsync()
        {
            WorkerRoleConfig config     = new WorkerRoleConfig();
            YamsConfig       yamsConfig = new YamsConfigBuilder(
                // mandatory configs
                DeploymentIdUtils.GetYamsClusterId(this.IsSingleClusterDeployment),
                RoleEnvironment.CurrentRoleInstance.UpdateDomain.ToString(),
                RoleEnvironment.CurrentRoleInstance.Id,
                config.CurrentRoleInstanceLocalStoreDirectory)
                                          // optional configs
                                          .SetCheckForUpdatesPeriodInSeconds(config.UpdateFrequencyInSeconds)
                                          .SetApplicationRestartCount(config.ApplicationRestartCount)
                                          .Build();

            _yamsService = YamsServiceFactory.Create(yamsConfig,
                                                     deploymentRepositoryStorageConnectionString: config.StorageDataConnectionString,
                                                     updateSessionStorageConnectionString: config.StorageDataConnectionString);

            try
            {
                Trace.TraceInformation("Yams is starting");
                await _yamsService.Start();

                Trace.TraceInformation("Yams has started. Looking for apps with deploymentId:" + yamsConfig.ClusterDeploymentId);
                while (true)
                {
                    await Task.Delay(1000);
                }
            }
            catch (Exception ex)
            {
                Trace.TraceError(ex.ToString());
            }
        }