refactor JournalStream into multi-thread
This commit is contained in:
14
EDJournalWatcher/EDJournalWatcher.csproj
Normal file
14
EDJournalWatcher/EDJournalWatcher.csproj
Normal 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>
|
||||
21
EDJournalWatcher/Program.cs
Normal file
21
EDJournalWatcher/Program.cs
Normal 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());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user