less locking for screen connection, force more concurrency
This commit is contained in:
parent
0b10695e07
commit
0e93b1356f
10 changed files with 143 additions and 93 deletions
|
@ -9,13 +9,13 @@ internal sealed class ClientScreenServer(
|
|||
ILoggerFactory loggerFactory
|
||||
) : WebsocketServer<ClientScreenServerConnection>(logger), IFrameConsumer
|
||||
{
|
||||
public Task HandleClientAsync(WebSocket socket, string? player)
|
||||
=> base.HandleClientAsync(new(
|
||||
public Task HandleClientAsync(WebSocket socket, Player? player)
|
||||
=> base.HandleClientAsync(new ClientScreenServerConnection(
|
||||
socket,
|
||||
loggerFactory.CreateLogger<ClientScreenServerConnection>(),
|
||||
player
|
||||
));
|
||||
|
||||
public ValueTask OnFrameDoneAsync(GamePixelGrid gamePixelGrid, PixelGrid observerPixels)
|
||||
=> ParallelForEachConnectionAsync(c => c.OnGameTickAsync(observerPixels, gamePixelGrid).AsTask());
|
||||
public async Task OnFrameDoneAsync(GamePixelGrid gamePixelGrid, PixelGrid observerPixels)
|
||||
=> await ParallelForEachConnectionAsync(c => c.OnGameTickAsync(observerPixels, gamePixelGrid).AsTask());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue