public DistributedEventBusService(IRedisFactory redisFactory, IMemoryEventBusService memoryEventBusService) { _connectionMultiplexer = redisFactory.CreateConnection(); _subscriber = _connectionMultiplexer.GetSubscriber(); _subscriber.Subscribe(GetChannel(), (channel, json) => { var jObj = JObject.Parse(json); var eventName = jObj.Value <string>("EventName"); var parameters = (JArray)jObj["Parameters"]; var invokeParameters = new List <object>(parameters.Count); foreach (var parameter in parameters) { var typeName = parameter.Value <string>("TypeName"); var content = parameter.Value <string>("Content"); var type = Type.GetType(typeName, false); if (type == null) { continue; } invokeParameters.Add(JsonConvert.DeserializeObject(content, type)); } try { memoryEventBusService.PublishRequest(eventName, invokeParameters.ToArray()); } catch (Exception ex) { _Logger.Error("DistributedEventBusService_Exception:", ex); } }); }
public AppStatsService(IAppUserService appUserService, IRedisFactory redisFactory, INumbersFactory numbersFactory) { this.appUserService = appUserService ?? throw new ArgumentNullException(nameof(appUserService)); this.redisFactory = redisFactory ?? throw new ArgumentNullException(nameof(redisFactory)); this.numbersFactory = numbersFactory ?? throw new ArgumentNullException(nameof(numbersFactory)); }
public UsersController(ILogger <UsersController> logger, IUsersService usersService, IConfiguration configuration, IUserRoleService userRoleService, IRedisFactory redisFactory) { _logger = logger; _usersService = usersService; _configuration = configuration; _userRoleService = userRoleService; _redisFactory = redisFactory; }
public RedisStore(IRedisFactory redisFactory, ICacheConfig cacheConfig, ICacheLogger cacheLogger) { this._cacheConfig = cacheConfig; this._cacheLogger = cacheLogger; long index = (typeof(T).FullName.Select(c => Convert.ToInt64(c)).Aggregate((cur, next) => cur + next)) % 16; this._cacheLogger.LogAsync($"Connecting to RedisDB:{index}", System.Diagnostics.Tracing.EventLevel.Verbose); this.DB = redisFactory.Connection?.GetDatabase((int)index); }
public AppUserService(IRedisFactory redisFactory) { this.redisFactory = redisFactory ?? throw new ArgumentNullException(nameof(redisFactory)); }
public NumbersFactory(IRedisFactory redisFactory) { this.redisFactory = redisFactory ?? throw new ArgumentNullException(nameof(redisFactory)); }
public CacheService(IRedisFactory redisFactory, ILogger <CacheService> logger) { _redisFactory = redisFactory; _logger = logger; }
public static IConnectionMultiplexer Default(this IRedisFactory redisFactory) { return(redisFactory.Get(Options.DefaultName)); }
public SignInEventBusProviders(IMemoryEventBusService memoryEventBusService, IRedisFactory redisFactory) { _memoryEventBusService = memoryEventBusService; _connectionMultiplexer = redisFactory.CreateConnection(); }
public UserService(IMemoryEventBusService memoryEventBusService, IRedisFactory redisFactory) { _memoryEventBusService = memoryEventBusService; _connectionMultiplexer = redisFactory.CreateConnection(); _cookieAccountId = CookieHelper.GetCookieValue(SystemConfig.CookiesKey); }
public RedisCacheManager(IRedisFactory redisFactory) { _redisFactory = redisFactory; }
public StoreCollectionProvider(IRedisFactory redisFactory, ICacheConfig cacheConfig, ICacheLogger cacheLogger) { this._redisFactory = redisFactory; this._cacheConfig = cacheConfig; this._cacheLogger = cacheLogger; }
public AdminAttribute(IRedisFactory redisFactory) { _connectionMultiplexer = redisFactory.CreateConnection(); }
public TokenService(IRedisFactory redisFactory) { _connectionMultiplexer = redisFactory.CreateConnection(); _database = _connectionMultiplexer.GetDatabase(); _channelId = 0019; }
public RedisCacheString(IRedisFactory redisFactory) : base(redisFactory) { }
public void TestFixtureSetUp() { this.redisFactory = new RedisFactory(); }
public RedisCacheHash(IRedisFactory redisFactory) { _redisFactory = redisFactory; }