generated from Nexus-Mods/NexusMods.App.Template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/NexusMods.EventSourcing.FasterKV/FasterKVEventStore.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System.Threading.Tasks; | ||
using FASTER.core; | ||
using NexusMods.EventSourcing.Abstractions; | ||
|
||
namespace NexusMods.EventSourcing.FasterKV; | ||
|
||
public class FasterKVEventStore<TSerializer> : IEventStore | ||
where TSerializer : IEventSerializer | ||
{ | ||
private readonly FasterKVSettings<SpanByteAndMemory, SpanByteAndMemory> _settings; | ||
private readonly FasterKV<SpanByteAndMemory,SpanByteAndMemory> _kvStore; | ||
|
||
|
||
public FasterKVEventStore(TSerializer serializer, Settings settings) | ||
{ | ||
_settings = new FasterKVSettings<SpanByteAndMemory, SpanByteAndMemory>(settings.StorageLocation.ToString()); | ||
_kvStore = new FasterKV<SpanByteAndMemory, SpanByteAndMemory>(_settings); | ||
} | ||
|
||
public ValueTask Add<T>(T eventEntity) where T : IEvent | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public void EventsForEntity<TIngester>(EntityId entityId, TIngester ingester) where TIngester : IEventIngester | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/NexusMods.EventSourcing.FasterKV/NexusMods.EventSourcing.FasterKV.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\NexusMods.EventSourcing.Abstractions\NexusMods.EventSourcing.Abstractions.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.FASTER.Core" Version="2.6.1" /> | ||
<PackageReference Include="NexusMods.Paths" Version="0.4.0" /> | ||
</ItemGroup> | ||
|
||
<Import Project="$([MSBuild]::GetPathOfFileAbove('NuGet.Build.props', '$(MSBuildThisFileDirectory)../'))" /> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
using NexusMods.Paths; | ||
|
||
namespace NexusMods.EventSourcing.FasterKV; | ||
|
||
public class Settings | ||
{ | ||
public AbsolutePath StorageLocation { get; set; } = default!; | ||
} |