Restructure solution into folders and fix persistence issues
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
37987a394a
commit
7c39cb5562
62 files changed
+219
-151
No files matched your search
@@ -0,0 +1,19 @@
|
||||
using Flypaper.Core.Abstractions;
|
||||
using Flypaper.Core.Models;
|
||||
|
||||
namespace Flypaper.Core.Runtime;
|
||||
|
||||
internal sealed class CountingTrapChannel(ITrapChannel inner) : ITrapChannel
|
||||
{
|
||||
private long _bytesSent;
|
||||
|
||||
public TrapSession Session => inner.Session;
|
||||
|
||||
public long BytesSent => Interlocked.Read(ref _bytesSent);
|
||||
|
||||
public async ValueTask WriteAsync(ReadOnlyMemory<byte> data, CancellationToken ct)
|
||||
{
|
||||
await inner.WriteAsync(data, ct);
|
||||
Interlocked.Add(ref _bytesSent, data.Length);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user