private void OnAccountContactRefresh(AccountContactRefreshRequest refreshRequest) { _logger.Trace("OnAccountContactRefresh({0}, {1}, {2})", refreshRequest.UserId, refreshRequest.Account.AccountId, refreshRequest.TriggeredBy); UserState userState; var userId = refreshRequest.UserId; lock (_gate) { if (!_userContactsMap.TryGetValue(userId, out userState)) { userState = new UserState(userId, _accountContactProviders); _userContactsMap[userId] = userState; _allUserContactUpdates.OnNext(userState); } } userState.RefreshAccount(refreshRequest.Account); }
private void RequestAccountRefresh(Guid userId, ContactRefreshTriggers triggeredBy, IAccount acc) { Logger.Trace("Requesting account refresh for userId:'{0}', AccountId:'{1}'", userId, acc.AccountId); var refreshRequest = new AccountContactRefreshRequest(userId, acc, triggeredBy); _accountRefreshRequests.OnNext(refreshRequest); }