public RedisUserRepository(string host, int port) { if (host == null) throw new ArgumentNullException("host"); if (port < 1) throw new ArgumentException("port is is invalid", "port"); RedisClient = new RedisClient(host, port); RedisUserClient = new RedisTypedClient<User>(RedisClient); }
public override void Init(int flowCount, long flowRecordCount) { clients = new RedisTypedClient <KeyValuePair <long, TickRecord> > [flowCount]; sortedSet = new RedisSortedSet(); for (int i = 0; i < flowCount; i++) { clients[i] = new RedisTypedClient <KeyValuePair <long, TickRecord> >(new RedisClient(Server, Port)); } clients[0].FlushAll();// Remove all keys from all databases }
public IRedisTypedClient <T> As <T>() { try { var typedClient = new RedisTypedClient <T>(this); LicenseUtils.AssertValidUsage(LicenseFeature.Redis, QuotaType.Types, __uniqueTypes.Count); return(typedClient); } catch (TypeInitializationException ex) { throw ex.GetInnerMostException(); } }
public override void Write(int flowID, IEnumerable <KeyValuePair <long, STS.General.Generators.Tick> > flow) { RedisTypedClient <KeyValuePair <long, TickRecord> > client = clients[flowID]; foreach (var kv in flow) { var data = kv.Value; TickRecord tick = new TickRecord( data.Symbol, TickRecord.DateTimeToUnixTimestamp(data.Timestamp), data.Bid, data.Ask, data.BidSize, data.AskSize, data.Provider); client.AddItemToSortedSet(sortedSet, new KeyValuePair <long, TickRecord>(kv.Key, tick)); } }
internal RedisTypedTransaction(RedisTypedClient <T> redisClient) : base(redisClient) { }
internal RedisTypedPipeline(RedisTypedClient <T> redisClient) : base(redisClient) { Init(); }
private void GenerateScoreUpdates_Click(object sender, RoutedEventArgs e) { scoreRedisClient = RedisClientFactory.GetRedisTypedClient<ScoreUpdate>(); teamIds = RedisClientFactory.GetRedisTypedClient<Team>().GetAllIds(); scoreTimer = new System.Timers.Timer(500); scoreTimer.Elapsed += scoreTimer_Elapsed; scoreTimer.Enabled = true; }
public RedisClientSet(RedisTypedClient <T> client, string setId) { this._client = client; this.Id = setId; }
public RedisClientHash(RedisTypedClient <T> client, string hashId) { this._client = client; this.Id = hashId; }
internal RedisTypedCommandQueue(RedisTypedClient <T> redisClient) { this.RedisClient = redisClient; }
public RedisClientList(RedisTypedClient <T> client, string listId) { this.Id = listId; this._client = client; }