Method ReadAsync
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
messageReadOnlyMemory<byte>The whole message: the header and the object's encoding, with nothing after it.
cancellationTokenCancellationTokenCancels 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.