Skip to content

Commit

Permalink
Extracted the types that an event store implementation needs to a sep…
Browse files Browse the repository at this point in the history
…arate LiquidProjections.Abstractions package. (#90)
  • Loading branch information
dennisdoomen authored May 4, 2017
1 parent 94fd8c1 commit 35e2d22
Show file tree
Hide file tree
Showing 39 changed files with 176 additions and 135 deletions.
7 changes: 7 additions & 0 deletions LiquidProjections.sln
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LiquidProjections.RavenDB",
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LiquidProjections.Testing", "Src\LiquidProjections.Testing\LiquidProjections.Testing.csproj", "{B4EA7831-8282-4F3A-A057-2DEB59611A68}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LiquidProjections.Abstractions", "Src\LiquidProjections.Abstractions\LiquidProjections.Abstractions.csproj", "{8E38C862-7DC9-4A7E-A2EE-921FFBC7EE2D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -81,6 +83,10 @@ Global
{B4EA7831-8282-4F3A-A057-2DEB59611A68}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B4EA7831-8282-4F3A-A057-2DEB59611A68}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B4EA7831-8282-4F3A-A057-2DEB59611A68}.Release|Any CPU.Build.0 = Release|Any CPU
{8E38C862-7DC9-4A7E-A2EE-921FFBC7EE2D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8E38C862-7DC9-4A7E-A2EE-921FFBC7EE2D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8E38C862-7DC9-4A7E-A2EE-921FFBC7EE2D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8E38C862-7DC9-4A7E-A2EE-921FFBC7EE2D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -96,5 +102,6 @@ Global
{7B47454D-0129-43CB-AED5-27AFAFDB5D7C} = {AE89AB5E-BC68-4AA3-9183-A222AC81691C}
{A3D8A417-F59C-476C-8F5E-F873390797FC} = {AE89AB5E-BC68-4AA3-9183-A222AC81691C}
{B4EA7831-8282-4F3A-A057-2DEB59611A68} = {AE89AB5E-BC68-4AA3-9183-A222AC81691C}
{8E38C862-7DC9-4A7E-A2EE-921FFBC7EE2D} = {AE89AB5E-BC68-4AA3-9183-A222AC81691C}
EndGlobalSection
EndGlobal
6 changes: 6 additions & 0 deletions Samples/ExampleHost/ExampleHost.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<WarningLevel>4</WarningLevel>
<UseVSHostingProcess>false</UseVSHostingProcess>
<LangVersion>6</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand All @@ -35,6 +36,7 @@
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>6</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Owin, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
Expand Down Expand Up @@ -141,6 +143,10 @@
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Src\LiquidProjections.Abstractions\LiquidProjections.Abstractions.csproj">
<Project>{8e38c862-7dc9-4a7e-a2ee-921ffbc7ee2d}</Project>
<Name>LiquidProjections.Abstractions</Name>
</ProjectReference>
<ProjectReference Include="..\..\Src\LiquidProjections.NEventStore\LiquidProjections.NEventStore.csproj">
<Project>{99faca9d-d5e8-4ef4-b552-eaea15b75b0d}</Project>
<Name>LiquidProjections.NEventStore</Name>
Expand Down
2 changes: 1 addition & 1 deletion Samples/ExampleHost/JsonFileEventStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace LiquidProjections.ExampleHost
{
public class JsonFileEventStore : IEventStore, IDisposable
public class JsonFileEventStore : IDisposable
{
private const int AverageEventsPerTransaction = 6;
private readonly int pageSize;
Expand Down
2 changes: 1 addition & 1 deletion Samples/ExampleHost/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public static void Main(string[] args)
EmbeddableDocumentStore store = BuildDocumentStore(".\\", 9001);

container.Register<Func<IAsyncDocumentSession>>(() => store.OpenAsyncSession());
var dispatcher = new Dispatcher(eventStore);
var dispatcher = new Dispatcher(eventStore.Subscribe);

var bootstrapper = new CountsProjector(dispatcher, store.OpenAsyncSession);

Expand Down
2 changes: 1 addition & 1 deletion Samples/ExampleHost/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@
[assembly: AssemblyVersion("1.2.2.0")]
[assembly: AssemblyFileVersion("1.2.2.0")]

[assembly: AssemblyInformationalVersion("1.2.2-SwitchToNetStandard.1+1.Branch.SwitchToNetStandard.Sha.6a74e3a2926492c3072c4c79a4f8d5e2130c5831")]
[assembly: AssemblyInformationalVersion("1.2.2+1.Branch.master.Sha.94fd8c18c50d6bdb4e1e77516cdc369b4416da8a")]
27 changes: 27 additions & 0 deletions Src/LiquidProjections.Abstractions/.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>LiquidProjections.Abstractions</id>
<version>0.0.0.0</version>
<authors>Dennis Doomen</authors>
<owners>Dennis Doomen</owners>
<projectUrl>https://github.com/liquidprojections/LiquidProjections</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>
Defines an abstraction for an event store that supports a transactionally consist group of events.
</description>
<tags>event-sourcing; projections; ddd</tags>
<frameworkAssemblies />
<releaseNotes/>
<dependencies>
<group>
<dependency id="LiquidProjections.Abstractions" version="$nugetversion$"/>
</group>
</dependencies>
</metadata>
<files>
<file src="bin\release\netstandard1.1\LiquidProjections.Abstractions.dll" target="lib\netstandard1.1" />
<file src="bin\release\netstandard1.1\LiquidProjections.Abstractions.pdb" target="lib\netstandard1.1" />
<file src="bin\release\netstandard1.1\LiquidProjections.Abstractions.xml" target="lib\netstandard1.1" />
</files>
</package>
19 changes: 19 additions & 0 deletions Src/LiquidProjections.Abstractions/CreateSubscription.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace LiquidProjections.Abstractions
{
/// <summary>
/// Creates a subscription on an event store, starting at the transaction following
/// <paramref name="lastProcessedCheckpoint"/>, identified by <paramref name="subscriptionId"/>, and which
/// passed transactions to the provided <paramref name="handler"/>.
/// </summary>
/// <param name="lastProcessedCheckpoint"></param>
/// <param name="handler"></param>
/// <param name="subscriptionId"></param>
/// <returns></returns>
public delegate IDisposable CreateSubscription(long? lastProcessedCheckpoint,
Func<IReadOnlyList<Transaction>, Task> handler,
string subscriptionId);
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace LiquidProjections
{
[Obsolete("Is replaced by the CreateSubscription delegate")]
public interface IEventStore
{
IDisposable Subscribe(long? lastProcessedCheckpoint, Func<IReadOnlyList<Transaction>, Task> handler,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard1.1</TargetFramework>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DocumentationFile>bin\Debug\netstandard1.1\LiquidProjections.Abstractions.xml</DocumentationFile>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<TreatSpecificWarningsAsErrors />
<NoWarn>1701;1702;1705;1591</NoWarn>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DocumentationFile>bin\Release\netstandard1.1\LiquidProjections.Abstractions.xml</DocumentationFile>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<TreatSpecificWarningsAsErrors />
<NoWarn>1701;1702;1705;1591</NoWarn>
</PropertyGroup>

</Project>
File renamed without changes.
2 changes: 1 addition & 1 deletion Src/LiquidProjections.NEventStore/.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<dependencies>
<group>
<dependency id="NEventStore" version="[5.0, 6.0)"/>
<dependency id="LiquidProjections" version="$nugetversion$"/>
<dependency id="LiquidProjections.Abstractions" version="$nugetversion$"/>
</group>
</dependencies>
</metadata>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LiquidProjections.Abstractions\LiquidProjections.Abstractions.csproj">
<Project>{8e38c862-7dc9-4a7e-a2ee-921ffbc7ee2d}</Project>
<Name>LiquidProjections.Abstractions</Name>
</ProjectReference>
<ProjectReference Include="..\LiquidProjections\LiquidProjections.csproj">
<Project>{7b47454d-0129-43cb-aed5-27afafdb5d7c}</Project>
<Name>LiquidProjections</Name>
Expand Down
2 changes: 1 addition & 1 deletion Src/LiquidProjections.NEventStore/NEventStoreAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace LiquidProjections.NEventStore
{
public class NEventStoreAdapter : IEventStore, IDisposable
public class NEventStoreAdapter : IDisposable
{
private readonly TimeSpan pollInterval;
private readonly int maxPageSize;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.2.2.0")]

[assembly: AssemblyInformationalVersion("1.2.2-SwitchToNetStandard.1+1.Branch.SwitchToNetStandard.Sha.caffa1249aacce07214f8e0eaae8bf87c845acb2")]
[assembly: AssemblyInformationalVersion("1.2.2+1.Branch.master.Sha.94fd8c18c50d6bdb4e1e77516cdc369b4416da8a")]
[assembly: AssemblyFileVersion("1.2.2.0")]
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,16 @@
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="NHibernateProjectionContext.cs" />
<Compile Include="NHibernateProjector.cs" />
<Compile Include="NHibernateTrackingStore.cs" />
</ItemGroup>
<ItemGroup>
<None Include=".nuspec" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LiquidProjections.Abstractions\LiquidProjections.Abstractions.csproj">
<Project>{8e38c862-7dc9-4a7e-a2ee-921ffbc7ee2d}</Project>
<Name>LiquidProjections.Abstractions</Name>
</ProjectReference>
<ProjectReference Include="..\LiquidProjections\LiquidProjections.csproj">
<Project>{7b47454d-0129-43cb-aed5-27afafdb5d7c}</Project>
<Name>LiquidProjections</Name>
Expand Down
35 changes: 0 additions & 35 deletions Src/LiquidProjections.NHibernate/NHibernateTrackingStore.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.2.2.0")]

[assembly: AssemblyInformationalVersion("1.2.2-SwitchToNetStandard.1+1.Branch.SwitchToNetStandard.Sha.caffa1249aacce07214f8e0eaae8bf87c845acb2")]
[assembly: AssemblyInformationalVersion("1.2.2+1.Branch.master.Sha.94fd8c18c50d6bdb4e1e77516cdc369b4416da8a")]
[assembly: AssemblyFileVersion("1.2.2.0")]
3 changes: 2 additions & 1 deletion Src/LiquidProjections.RavenDB/IProjectionCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ Task<TProjection> Get<TProjection>(string key, Func<Task<TProjection>> createPro
/// <summary>
/// Removes the item identified by <paramref name="key"/> from the cache.
/// </summary>
/// <remarks>
/// This method must be safe in multi-threaded scenarios and be idempotent.
/// </summary>
/// </remarks>
void Remove(string key);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,16 @@
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|netstandard1.3|AnyCPU'">
<DefineConstants>TRACE;DEBUG;NETSTANDARD1_3;LIBLOG_PORTABLE</DefineConstants>
<DocumentationFile>bin\Debug\netstandard1.3\LiquidProjections.RavenDB.xml</DocumentationFile>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<TreatSpecificWarningsAsErrors />
<NoWarn>1701;1702;1705;1591</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|netstandard1.3|AnyCPU'">
<DefineConstants>TRACE;RELEASE;NETSTANDARD1_3;LIBLOG_PORTABLE</DefineConstants>
<DocumentationFile>bin\Release\netstandard1.3\LiquidProjections.RavenDB.xml</DocumentationFile>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<TreatSpecificWarningsAsErrors />
<NoWarn>1701;1702;1705;1591</NoWarn>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\..\SharedAssemblyInfo.cs" Link="SharedAssemblyInfo.cs" />
Expand All @@ -26,6 +32,7 @@
<PackageReference Include="RavenDB.Client" Version="3.5.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LiquidProjections.Abstractions\LiquidProjections.Abstractions.csproj" />
<ProjectReference Include="..\LiquidProjections\LiquidProjections.csproj" />
</ItemGroup>
</Project>
39 changes: 0 additions & 39 deletions Src/LiquidProjections.RavenDB/RavenTrackingStore.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,24 @@

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DocumentationFile>bin\Debug\netstandard1.1\LiquidProjections.Testing.xml</DocumentationFile>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<TreatSpecificWarningsAsErrors />
<NoWarn>1701;1702;1705;1591</NoWarn>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DocumentationFile>bin\Release\netstandard1.1\LiquidProjections.Testing.xml</DocumentationFile>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<TreatSpecificWarningsAsErrors />
<NoWarn>1701;1702;1705;1591</NoWarn>
</PropertyGroup>

<ItemGroup>
<Compile Include="..\..\SharedAssemblyInfo.cs" Link="SharedAssemblyInfo.cs" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\LiquidProjections.Abstractions\LiquidProjections.Abstractions.csproj" />
<ProjectReference Include="..\LiquidProjections\LiquidProjections.csproj" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion Src/LiquidProjections.Testing/MemoryEventSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace LiquidProjections
{
public class MemoryEventSource : IEventStore
public class MemoryEventSource
{
private readonly int batchSize;
private long lastCheckpoint;
Expand Down
3 changes: 2 additions & 1 deletion Src/LiquidProjections/.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@
<owners>Dennis Doomen</owners>
<projectUrl>https://github.com/liquidprojections/LiquidProjections</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Defines a light-weight abstraction on top of an event store and allows mapping these to projection code using a fluent API.</description>
<description>Provides basic building blocks for creating asynchronous projectors that subscribe to an event store.</description>
<tags>event-sourcing; projections; ddd</tags>
<frameworkAssemblies />
<releaseNotes/>
<dependencies>
<group>
<dependency id="LiquidProjections.Abstractions" version="$nugetversion$"/>
</group>
</dependencies>
</metadata>
Expand Down
Loading

0 comments on commit 35e2d22

Please sign in to comment.