Esempio n. 1
0
 private void OnBatchCompleted(T item, TimePoint timestamp)
 {
     if (this.batches.TryUpdate(item, default, timestamp))
     {
         this.subscriptions[item](item);
     }
 }
Esempio n. 2
0
 public void Add(T item, TimePoint timestamp)
 {
     if (this.batches.TryUpdate(item, timestamp, default))
     {
         this.OnBatchCreated(item, timestamp);
     }
 }
        public IDisposable Subscribe(string file, Action <FileInfo> onUpdate)
        {
            FileInfo item = new FileInfo(Path.Combine(this.path, file));

            return(new CompositeDisposable(
                       this.batchedEvents.Subscribe(item, onUpdate),
                       this.inner.Subscribe(file, f => this.batchedEvents.Add(item, TimePoint.Now()))));
        }
Esempio n. 4
0
 private void OnBatchCreated(T item, TimePoint timestamp)
 {
     this.delay().ContinueWith(t => this.OnBatchCompleted(item, timestamp), TaskContinuationOptions.ExecuteSynchronously);
 }