Skip to content

Commit

Permalink
Merge pull request #73 from y-crdt/move-protocol
Browse files Browse the repository at this point in the history
Move protocol extensions to root project.
  • Loading branch information
SebastianStehle authored Jan 11, 2024
2 parents 229fd82 + b79d3dd commit 04f798e
Show file tree
Hide file tree
Showing 13 changed files with 523 additions and 202 deletions.
3 changes: 2 additions & 1 deletion YDotNet.Server.Redis/RedisDocumentStorage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ private async Task InitializeAsync(RedisConnection redisConnection)
database = connection.GetDatabase(redisOptions.Database);
}

public async ValueTask<byte[]?> GetDocAsync(string name,
public async ValueTask<byte[]?> GetDocAsync(
string name,
CancellationToken ct = default)
{
if (database == null)
Expand Down
63 changes: 0 additions & 63 deletions YDotNet.Server.WebSockets/EncoderExtensions.cs

This file was deleted.

15 changes: 0 additions & 15 deletions YDotNet.Server.WebSockets/MessageTypes.cs

This file was deleted.

10 changes: 5 additions & 5 deletions YDotNet.Server.WebSockets/WebSocketEncoder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ public void Dispose()
{
}

public override ValueTask FlushAsync(CancellationToken ct = default)
{
return new ValueTask(webSocket.SendAsync(Array.Empty<byte>(), WebSocketMessageType.Binary, true, ct));
}

protected override ValueTask WriteByteAsync(byte value, CancellationToken ct)
{
buffer[0] = value;
Expand All @@ -28,9 +33,4 @@ protected override ValueTask WriteBytesAsync(ArraySegment<byte> bytes, Cancellat
{
return new ValueTask(webSocket.SendAsync(bytes, WebSocketMessageType.Binary, false, ct));
}

public ValueTask FlushAsync(CancellationToken ct = default)
{
return new ValueTask(webSocket.SendAsync(Array.Empty<byte>(), WebSocketMessageType.Binary, true, ct));
}
}
Loading

0 comments on commit 04f798e

Please sign in to comment.