コード例 #1
0
ファイル: BatchedEvents.cs プロジェクト: sujit1779/writeasync
 private void OnBatchCompleted(T item, TimePoint timestamp)
 {
     if (this.batches.TryUpdate(item, default, timestamp))
     {
         this.subscriptions[item](item);
     }
 }
コード例 #2
0
ファイル: BatchedEvents.cs プロジェクト: sujit1779/writeasync
 public void Add(T item, TimePoint timestamp)
 {
     if (this.batches.TryUpdate(item, timestamp, default))
     {
         this.OnBatchCreated(item, timestamp);
     }
 }
コード例 #3
0
        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()))));
        }
コード例 #4
0
ファイル: BatchedEvents.cs プロジェクト: sujit1779/writeasync
 private void OnBatchCreated(T item, TimePoint timestamp)
 {
     this.delay().ContinueWith(t => this.OnBatchCompleted(item, timestamp), TaskContinuationOptions.ExecuteSynchronously);
 }