Class ReadRequest
- Namespace
- Nexus.Extensibility
- Assembly
- Nexus.Extensibility.dll
A read request.
public sealed class ReadRequest
- Inheritance
-
ReadRequest
- Inherited Members
Remarks
This type carries runtime buffers and completion callbacks and is not a serialization contract. Use a separate DTO at process or wire boundaries.
Constructors
ReadRequest(string, CatalogItem, Memory<byte>, Memory<byte>, Func<CancellationToken, Task>, CancellationToken)
Initializes a read request.
public ReadRequest(string originalResourceName, CatalogItem catalogItem, Memory<byte> data, Memory<byte> status, Func<CancellationToken, Task> onCompleted, CancellationToken cancellationToken)
Parameters
originalResourceNamestringThe original resource name.
catalogItemCatalogItemThe catalog item to be read.
dataMemory<byte>The data buffer.
statusMemory<byte>The status buffer. A value of 0x01 ('1') indicates that the corresponding value in the data buffer is valid, otherwise it is treated as NaN or NaN, respectively.
onCompletedFunc<CancellationToken, Task>The host callback to run once when the request is completed.
cancellationTokenCancellationTokenThe host-owned cancellation token for completion.
Properties
CatalogItem
The catalog item to be read.
public CatalogItem CatalogItem { get; }
Property Value
Data
The data buffer.
public Memory<byte> Data { get; }
Property Value
OriginalResourceName
The original resource name.
public string OriginalResourceName { get; }
Property Value
Status
The status buffer. A value of 0x01 ('1') indicates that the corresponding value in the data buffer is valid, otherwise it is treated as NaN.
public Memory<byte> Status { get; }
Property Value
Methods
CompleteAsync()
Called by the data source when Data and Status are fully populated. The framework flushes the resource to its pipe immediately.
public Task CompleteAsync()