Browse files

- swapped in latest Rx (1.0,10605)

- removed some overly spammydebug logging
- exposed manual merge call on FirkinDictionary
  • Loading branch information...
1 parent 9442ebd commit 4815af2e3aed6ce7116c19f8f977accdc60d1710 @sdether committed Jun 27, 2011
View
4 Firkin.Reactive.Test/Firkin.Reactive.Test.csproj
@@ -43,9 +43,7 @@
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
- <Reference Include="System.CoreEx, Version=1.0.2856.102, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
- <Reference Include="System.Observable, Version=1.0.0.102, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
- <Reference Include="System.Reactive, Version=1.0.2856.102, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
+ <Reference Include="System.Reactive, Version=1.0.10605.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
View
1 Firkin.Reactive.Test/TIObservableFirkinHash.cs
@@ -19,6 +19,7 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
+using System.Reactive;
using System.Threading;
using Droog.Firkin;
using Droog.Firkin.Test;
View
4 Firkin.Reactive/Firkin.Reactive.csproj
@@ -35,9 +35,7 @@
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
- <Reference Include="System.CoreEx, Version=1.0.2856.102, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
- <Reference Include="System.Observable, Version=1.0.0.102, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
- <Reference Include="System.Reactive, Version=1.0.2856.102, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
+ <Reference Include="System.Reactive, Version=1.0.10605.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
View
27 Firkin.Reactive/ObservableFirkinHash.cs
@@ -18,28 +18,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
+using System.Reactive.Subjects;
using Droog.Firkin;
using Droog.Firkin.Serialization;
namespace Firkin.Reactive {
public class ObservableFirkinHash<TKey> : FirkinHash<TKey>, IObservableFirkinHash<TKey> {
- //--- Types ---
- private class DisposableClosure : IDisposable {
- private readonly Action _dispose;
-
- public DisposableClosure(Action dispose) {
- _dispose = dispose;
- }
-
- public void Dispose() {
- _dispose();
- }
- }
-
-
//--- Fields ---
- private Subject<FirkinHashChange<TKey>> _observable = new Subject<FirkinHashChange<TKey>>();
+ private readonly Subject<FirkinHashChange<TKey>> _observable = new Subject<FirkinHashChange<TKey>>();
//--- Constructors ---
public ObservableFirkinHash(string storeDirectory)
@@ -78,14 +65,16 @@ public ObservableFirkinHash(string storeDirectory, long maxFileSize, IByteArrayS
private void OnNext(FirkinHashChange<TKey> value) {
CheckDisposed();
- _observable.OnNext(value);
+ lock(_observable) {
+ _observable.OnNext(value);
+ }
}
-
-
private void OnCompleted() {
CheckDisposed();
- _observable.OnCompleted();
+ lock(_observable) {
+ _observable.OnCompleted();
+ }
}
}
}
View
4 Firkin.Test.Perf/Firkin.Test.Perf.csproj
@@ -48,9 +48,7 @@
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
- <Reference Include="System.CoreEx, Version=1.0.2856.102, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
- <Reference Include="System.Observable, Version=1.0.0.102, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
- <Reference Include="System.Reactive, Version=1.0.2856.102, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
+ <Reference Include="System.Reactive, Version=1.0.10605.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
View
1 Firkin.Test.Perf/TAsync.cs
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
+using System.Reactive.Linq;
using System.Threading;
using NUnit.Framework;
View
1 Firkin.Test.Perf/TStackoverflow.cs
@@ -20,6 +20,7 @@
using System.Configuration;
using System.IO;
using System.Linq;
+using System.Reactive;
using System.Xml;
using System.Xml.Serialization;
using Droog.Firkin.Test.Perf.Stackoverflow;
View
4 Firkin/FirkinDictionary.cs
@@ -133,6 +133,10 @@ public class FirkinDictionary<TKey, TValue> : IDictionary<TKey, TValue>, IDispos
get { return this.Select(x => x.Value).ToList(); }
}
+ public void Merge() {
+ _hash.Merge();
+ }
+
private MemoryStream GetStream(TValue value) {
var stream = new MemoryStream();
_valueSerializer.Serialize(stream, value);
View
4 Firkin/FirkinHash.cs
@@ -42,7 +42,7 @@ private class MergePair {
public IFirkinActiveFile Data;
public IFirkinHintFile Hint;
}
-
+
//--- Class Fields ---
protected static readonly ILog _log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
@@ -230,8 +230,8 @@ private class MergePair {
} else {
newIndex[key] = pair.Value;
}
- _log.DebugFormat("added entries from file {0}: {1}", file.FileId, newIndex.Count);
}
+ _log.DebugFormat("added entries from file {0}: {1}", file.FileId, newIndex.Count);
}
// swap out index and file list

0 comments on commit 4815af2

Please sign in to comment.