Skip to content

Interface IRpcFrameChannel

Namespace: DotBoxD.Services.Transport
Assembly: DotBoxD.Services.dll

Optional low-allocation transport contract for channels that can transfer ownership of complete pooled frames instead of copying them into a new DotBoxD.Services.Buffers.Payload.

public interface IRpcFrameChannel : IRpcValueTaskChannel, IRpcChannel, IAsyncDisposable

IRpcValueTaskChannel, IRpcChannel, IAsyncDisposable

ReceiveFrameValueAsync(CancellationToken)

Section titled “ ReceiveFrameValueAsync(CancellationToken)”

Receives a complete frame whose ownership transfers to the caller on successful completion.

ValueTask<RpcFrame> ReceiveFrameValueAsync(CancellationToken ct = default)

ct CancellationToken

ValueTask<RpcFrame>

The caller must consume the returned logical frame exactly once by calling either DotBoxD.Services.Transport.RpcFrame.DetachPayload or DotBoxD.Services.Transport.RpcFrame.Dispose.

SendFrameValueAsync(PooledBufferWriter, CancellationToken)

Section titled “ SendFrameValueAsync(PooledBufferWriter, CancellationToken)”

Sends a complete pooled frame and transfers its ownership to the channel.

ValueTask SendFrameValueAsync(PooledBufferWriter frame, CancellationToken ct = default)

frame PooledBufferWriter

ct CancellationToken

ValueTask

Ownership transfers immediately when this invocation returns a System.Threading.Tasks.ValueTask, including an already faulted or canceled result. The channel then owns frame through terminal success, failure, or cancellation and must dispose it; the caller must not read, detach, or dispose it. If the invocation throws synchronously, ownership remains with the caller, which must dispose the frame. The implementation must drop its raw writer reference when the returned operation terminates.

ArgumentNullException

frame is null.