Table of Contents

Method ReadAsync

Namespace
AvroSharp.Messages
Assembly
AvroSharp.dll

ReadAsync(ReadOnlyMemory<byte>, CancellationToken)

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

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

Parameters

message ReadOnlyMemory<byte>

The whole message: the header and the object's encoding, with nothing after it.

cancellationToken CancellationToken

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

Returns

ValueTask<T>

Exceptions

AvroDataException

The message has no single-object header, the resolver does not know its schema, or its data is malformed or has bytes left over. Reported through the returned task, as every other failure is.