Table of Contents

Method ReadAsync

Namespace
AvroSharp.Messages
Assembly
AvroSharp.dll

ReadAsync(ReadOnlyMemory<byte>, CancellationToken)

Reads one framed message, fetching its schema through the resolver when its ID is new.

public ValueTask<T> ReadAsync(ReadOnlyMemory<byte> message, CancellationToken cancellationToken = default)

Parameters

message ReadOnlyMemory<byte>

The whole message.

cancellationToken CancellationToken

Cancels a fetch. Concurrent reads of the same new ID fetch it once: the others wait for it.

Returns

ValueTask<T>

Exceptions

AvroDataException

The header is malformed, no schema has the ID, or the data is malformed. Reported through the returned task, as every other failure is.