refactor JournalStream into multi-thread

This commit is contained in:
2025-08-01 12:43:16 +02:00
parent f21bf5ea5e
commit ed68876300
4 changed files with 198 additions and 18 deletions

View File

@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\EDPlayerJournal\EDPlayerJournal.csproj" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,21 @@
using EDPlayerJournal;
using EDPlayerJournal.Entries;
namespace EDJournalWatcher;
public class Program {
public static void Main(string[] args) {
PlayerJournal journal = new();
JournalStream stream = new(journal);
stream.NewJournalEntry += Stream_NewJournalEntry;
while (true) {
stream.ProcessQueues();
}
}
private static void Stream_NewJournalEntry(Entry entry) {
Console.WriteLine(entry.ToString());
}
}