예제 #1
0
 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();
     };
 }
예제 #2
0
 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();
     };
 }
예제 #3
0
 static UserProxy()
 {
     _userQueue = new DatabaseWriterQueue <long, TwitterUser>(50, TimeSpan.FromSeconds(30),
                                                              async u => await StoreUsersAsync(u).ConfigureAwait(false));
     App.ApplicationFinalize += () => _userQueue.Dispose();
 }
예제 #4
0
 static UserProxy()
 {
     _userQueue = new DatabaseWriterQueue<long, TwitterUser>(50, TimeSpan.FromSeconds(30),
         async u => await StoreUsersAsync(u).ConfigureAwait(false));
     App.ApplicationFinalize += () => _userQueue.Dispose();
 }