-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
15 changed files
with
168 additions
and
142 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
This file was deleted.
Oops, something went wrong.
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
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
This file was deleted.
Oops, something went wrong.
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,4 @@ | ||
namespace EvenireDB | ||
{ | ||
internal record CachedEvents(List<IEvent> Events, SemaphoreSlim Semaphore); | ||
} |
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
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,38 @@ | ||
namespace EvenireDB | ||
{ | ||
public record class EvenireServerSettings | ||
{ | ||
/// <summary> | ||
/// max page size returned to clients | ||
/// </summary> | ||
public uint MaxPageSizeToClient { get; init; } = 100; | ||
|
||
/// <summary> | ||
/// max page size when parsing events from disk | ||
/// </summary> | ||
public uint MaxEventsPageSizeFromDisk { get; init; } = 100; | ||
|
||
/// <summary> | ||
/// max allowed event data size | ||
/// </summary> | ||
public uint MaxEventDataSize { get; init; } = 500_000; | ||
|
||
public string? DataFolder { get; init; } | ||
|
||
public int HttpPort { get; init; } = 16281; | ||
public int GrpcPort { get; init; } = 16282; | ||
|
||
/// <summary> | ||
/// max number of streams to cache in memory | ||
/// </summary> | ||
public uint MaxInMemoryStreamsCount { get; init; } = 1000; | ||
|
||
/// <summary> | ||
/// max allowed memory allocated by the process. If exceeded, the system will try to recover | ||
/// some memory by dropping some cached streams | ||
/// </summary> | ||
public long MaxAllowedAllocatedBytes { get; init; } = 1_000_000_000; // TODO: consider making this a function of max allowed streams count and max event data size | ||
|
||
public TimeSpan MemoryWatcherInterval { get; init; } = TimeSpan.FromMinutes(2); | ||
} | ||
} |
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
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
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,11 @@ | ||
using EvenireDB.Common; | ||
using System.Runtime.CompilerServices; | ||
|
||
namespace EvenireDB | ||
{ | ||
public interface IEventsProvider | ||
{ | ||
ValueTask<IOperationResult> AppendAsync(Guid streamId, IEnumerable<IEvent> incomingEvents, CancellationToken cancellationToken = default); | ||
IAsyncEnumerable<IEvent> ReadAsync(Guid streamId, StreamPosition startPosition, Direction direction = Direction.Forward, [EnumeratorCancellation] CancellationToken cancellationToken = default); | ||
Check warning on line 9 in src/EvenireDB/IEventsProvider.cs GitHub Actions / build
|
||
} | ||
} |
Oops, something went wrong.