devlooped / WebSocketPipe

System.IO.Pipelines API adapter for System.Net.WebSockets

Home Page:https://clarius.org/WebSocketPipe

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Switch to ValueTask for async methods

kzu opened this issue · comments

We only have CompleteAsync and RunAsync on IWebSocketPipe, but since the underlying primitives we invoke on either the pipe reader/writer or websocket, all return ValueTask to avoid allocations, we might as well follow suit.

Background: https://devblogs.microsoft.com/dotnet/understanding-the-whys-whats-and-whens-of-valuetask/