Method GetAsync
- Namespace
- NATS.Client.ObjectStore
- Assembly
- NATS.Client.ObjectStore.dll
GetAsync(string, Stream, bool, CancellationToken)
Get object by key.
ValueTask<ObjectMetadata> GetAsync(string key, Stream stream, bool leaveOpen = false, CancellationToken cancellationToken = default)
Parameters
key
stringObject key.
stream
StreamStream to write the object value to.
leaveOpen
booltrue
to not close the underlying stream when async method returns; otherwise,false
cancellationToken
CancellationTokenA CancellationToken used to cancel the API call.
Returns
- ValueTask<ObjectMetadata>
Object metadata.
Exceptions
- NatsObjException
Metadata didn't match the value retrieved e.g. the SHA digest.