static StatusProxy() { _statusQueue = new DatabaseWriterQueue<long, TwitterStatus>(200, TimeSpan.FromSeconds(30), async s => await StoreStatusesAsync(s).ConfigureAwait(false)); _favoriteQueue = new ActivityQueue(50, TimeSpan.FromSeconds(30), s => Task.Run(() => Database.FavoritesCrud.InsertAllAsync(s)), s => Task.Run(() => Database.FavoritesCrud.DeleteAllAsync(s))); _retweetQueue = new ActivityQueue(50, TimeSpan.FromSeconds(30), s => Task.Run(() => Database.RetweetsCrud.InsertAllAsync(s)), s => Task.Run(() => Database.RetweetsCrud.DeleteAllAsync(s))); App.ApplicationFinalize += () => { _statusQueue.Dispose(); _favoriteQueue.Writeback(); _retweetQueue.Writeback(); }; }
static StatusProxy() { _statusQueue = new DatabaseWriterQueue <long, TwitterStatus>(200, TimeSpan.FromSeconds(30), async s => await StoreStatusesAsync(s).ConfigureAwait(false)); _favoriteQueue = new ActivityQueue(50, TimeSpan.FromSeconds(30), s => Task.Run(() => Database.FavoritesCrud.InsertAllAsync(s)), s => Task.Run(() => Database.FavoritesCrud.DeleteAllAsync(s))); _retweetQueue = new ActivityQueue(50, TimeSpan.FromSeconds(30), s => Task.Run(() => Database.RetweetsCrud.InsertAllAsync(s)), s => Task.Run(() => Database.RetweetsCrud.DeleteAllAsync(s))); App.ApplicationFinalize += () => { _statusQueue.Dispose(); _favoriteQueue.Writeback(); _retweetQueue.Writeback(); }; }
static UserProxy() { _userQueue = new DatabaseWriterQueue <long, TwitterUser>(50, TimeSpan.FromSeconds(30), async u => await StoreUsersAsync(u).ConfigureAwait(false)); App.ApplicationFinalize += () => _userQueue.Dispose(); }
static UserProxy() { _userQueue = new DatabaseWriterQueue<long, TwitterUser>(50, TimeSpan.FromSeconds(30), async u => await StoreUsersAsync(u).ConfigureAwait(false)); App.ApplicationFinalize += () => _userQueue.Dispose(); }