Method ReadAsync
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
messageReadOnlyMemory<byte>The whole message.
cancellationTokenCancellationTokenCancels 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.