public async Task Run() { var cancellationTokenSource = new CancellationTokenSource(); var userId = await _servicesClient.GetUserId(cancellationTokenSource.Token); if (userId == null) { return; // probably cancelled } await _callControllers.Initialize(); _loadBalancerProtocol.UserId = userId; var keyInfoTask = _keysClient.Run(cancellationTokenSource.Token); var callManagement = _loadBalancerProtocol.Run(); var removeExpired = RemoveExpiredControllers(); var webdateWeb = UpdateWeb(); var serviceClientTask = _servicesClient.ServiceRegistration(cancellationTokenSource.Token); await TaskCordinator.WaitAll( keyInfoTask, callManagement, removeExpired, webdateWeb, serviceClientTask); }
public async Task Run() { var cancellationTokenSource = new CancellationTokenSource(); var userId = await _servicesClient.GetUserId(cancellationTokenSource.Token); if (userId == null) { return; //probably cancelled } _loadBalancerProtocol.UserId = userId; _ropuProtocol.UserId = userId.Value; Task keyInfoTask = _keysClient.Run(cancellationTokenSource.Token); Task waitForKeysTask = _keysClient.WaitForkeys(); await Task.WhenAny(keyInfoTask, waitForKeysTask); //this way we will know of error fromt eh keyInfoTask Task callManagementTask = _loadBalancerProtocol.Run(); Task mediaTask = _ropuProtocol.Run(); Task regisrationExpiryTask = _registra.CheckExpiries(); Task registrationTask = _servicesClient.ServiceRegistration(cancellationTokenSource.Token); Task registerTask = Register(); await TaskCordinator.WaitAll(callManagementTask, mediaTask, registerTask, regisrationExpiryTask, registrationTask, keyInfoTask); }
public async Task Run() { var cancellationTokenSource = new CancellationTokenSource(); uint?userId = await _servicesClient.GetUserId(cancellationTokenSource.Token); if (userId == null) { return; //must have been cancelled } var keysClientTask = _keysClient.Run(cancellationTokenSource.Token); await _keysClient.WaitForkeys(); _loadBalancerProtocol.UserId = userId; var loadBalancerTask = _loadBalancerProtocol.Run(); var ropuProtocolTask = _ropuProtocol.Run(); var registerTask = Register(); var serviceClientTask = _servicesClient.ServiceRegistration(cancellationTokenSource.Token); await TaskCordinator.WaitAll( loadBalancerTask, registerTask, ropuProtocolTask, serviceClientTask, keysClientTask); }